mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
fa27350977
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> |
||
---|---|---|
.. | ||
benches | ||
00_infra.js | ||
01_dom_exception.js | ||
01_mimesniff.js | ||
02_event.js | ||
02_structured_clone.js | ||
02_timers.js | ||
03_abort_signal.js | ||
04_global_interfaces.js | ||
05_base64.js | ||
06_streams.js | ||
06_streams_types.d.ts | ||
08_text_encoding.js | ||
09_file.js | ||
10_filereader.js | ||
12_location.js | ||
13_message_port.js | ||
14_compression.js | ||
15_performance.js | ||
16_image_data.js | ||
blob.rs | ||
Cargo.toml | ||
compression.rs | ||
internal.d.ts | ||
lib.deno_web.d.ts | ||
lib.rs | ||
message_port.rs | ||
README.md | ||
stream_resource.rs | ||
timers.rs |
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/.