1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
denoland-deno/ext/web
Milly fa27350977
fix(ext/web): ReadableStream.from() ignores null Symbol.asyncIterator (#23910)
If `@@asyncIterator` is `null` or `undefined`, it should ignores and
fallback to `@@iterator`.

Tests have been merged into WPT.
https://github.com/web-platform-tests/wpt/pull/46374

The proposal of `ReadableStream.from` uses TC39 [GetIterator][] and
[GetMethod][] within it.
GetMethod treats null as undefined.
So if `@@asyncIterator` is `null` it should be ignored and fallback to
`@@iterator`.

[GetIterator]: https://tc39.es/ecma262/#sec-getiterator
[GetMethod]: https://tc39.es/ecma262/#sec-getmethod

```bash
> deno eval "ReadableStream.from({ [Symbol.asyncIterator]: null, [Symbol.iterator]: () => ({ next: () => ({ done: true }) }) }).pipeTo(new WritableStream())"
error: Uncaught (in promise) TypeError: obj[SymbolAsyncIterator] is not a function
ReadableStream.from({ [Symbol.asyncIterator]: null, [Symbol.iterator]: () => ({ next: () => ({ done: true }) }) }).pipeTo(new WritableStream())
               ^
    at getIterator (ext:deno_web/06_streams.js:5105:38)
    at Function.from (ext:deno_web/06_streams.js:5207:22)
    at file:///D:/work/js/deno/tests/wpt/suite/$deno$eval:1:16
```

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-05-23 13:55:07 +02:00
..
benches perf(cli): use new deno_core timers (#22569) 2024-03-01 11:15:18 -07:00
00_infra.js fix: Support Symbol.metadata (#22282) 2024-02-06 14:57:25 +01:00
01_dom_exception.js fix: DOMException doesn't throw on __callSitesEvals (#23729) 2024-05-07 21:02:29 +00:00
01_mimesniff.js refactor(ext/web): use relative specifiers (#23024) 2024-03-22 17:21:05 +01:00
02_event.js fix(runtime): use more null proto objects (#23921) 2024-05-23 00:03:35 +02:00
02_structured_clone.js fix: Float16Array support (#23512) 2024-04-23 22:54:19 +02:00
02_timers.js perf(cli): use new deno_core timers (#22569) 2024-03-01 11:15:18 -07:00
03_abort_signal.js perf(ext/http): recover memory for serve and optimize AbortController (#23559) 2024-04-25 14:52:24 -04:00
04_global_interfaces.js refactor(ext/web): use relative specifiers (#23024) 2024-03-22 17:21:05 +01:00
05_base64.js refactor(ext/web): use relative specifiers (#23024) 2024-03-22 17:21:05 +01:00
06_streams.js fix(ext/web): ReadableStream.from() ignores null Symbol.asyncIterator (#23910) 2024-05-23 13:55:07 +02:00
06_streams_types.d.ts chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
08_text_encoding.js fix(runtime): use more null proto objects (#23921) 2024-05-23 00:03:35 +02:00
09_file.js fix(runtime): use more null proto objects (#23921) 2024-05-23 00:03:35 +02:00
10_filereader.js refactor(ext/web): use relative specifiers (#23024) 2024-03-22 17:21:05 +01:00
12_location.js refactor(ext/web): use relative specifiers (#23024) 2024-03-22 17:21:05 +01:00
13_message_port.js fix(runtime): use more null proto objects (#23921) 2024-05-23 00:03:35 +02:00
14_compression.js refactor(ext/web): use relative specifiers (#23024) 2024-03-22 17:21:05 +01:00
15_performance.js fix(runtime): use more null proto objects (#23921) 2024-05-23 00:03:35 +02:00
16_image_data.js refactor(ext/web): use relative specifiers (#23024) 2024-03-22 17:21:05 +01:00
blob.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
Cargo.toml chore: forward v1.43.6 release commit to main (#23936) 2024-05-22 01:35:04 +00:00
compression.rs fix(ext/web): Prevent (De-)CompressionStream resource leak on stream cancellation (#21199) 2024-02-13 21:45:23 +00:00
internal.d.ts fix(ext/node) implement receiveMessageOnPort for node:worker_threads (#22766) 2024-03-11 00:23:06 +01:00
lib.deno_web.d.ts docs: update categories to match new planned sitemap (#23677) 2024-05-05 18:56:55 -07:00
lib.rs fix(ext/node): support MessagePort in WorkerOptions.workerData (#22950) 2024-03-16 01:59:18 +01:00
message_port.rs fix(ext/node): worker_threads.receiveMessageOnPort doesn't panic (#23406) 2024-04-16 18:41:03 +00:00
README.md Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
stream_resource.rs fix(ext/web): fix potential leak of unread buffers (#23923) 2024-05-21 17:45:33 +00:00
timers.rs chore: enable clippy unused_async rule (#22834) 2024-03-11 23:48:00 -04:00

deno web

Op crate that implements Event, TextEncoder, TextDecoder and File API (https://w3c.github.io/FileAPI).

Testing for text encoding is done via WPT in cli/.