1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-26 00:59:24 -05:00
denoland-deno/tests
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
..
config chore: move test_util/std to tests/util/std (#22402) 2024-02-13 09:22:49 -07:00
ffi chore: enable clippy::print_stdout and clippy::print_stderr (#23732) 2024-05-08 22:45:06 -04:00
integration fix(lsp): process Fenced Code Block in JSDoc on completion correctly (#23822) 2024-05-22 12:00:14 -07:00
napi chore: enable clippy::print_stdout and clippy::print_stderr (#23732) 2024-05-08 22:45:06 -04:00
node_compat chore: kill node.js tests if they run too long (#23956) 2024-05-22 20:27:24 -06:00
registry fix(lsp): apply import fix to missing declaration code action (#23924) 2024-05-21 21:15:16 +01:00
specs feat(cli/test): deno test --clean (#23519) 2024-05-23 03:04:12 +00:00
testdata feat: enable pointer compression via deno_core bump (#23838) 2024-05-23 03:04:59 +00:00
unit feat(ext/fetch): Request.bytes() and Response.bytes() (#23823) 2024-05-23 00:27:58 +00:00
unit_node feat(ext/fetch): Request.bytes() and Response.bytes() (#23823) 2024-05-23 00:27:58 +00:00
util chore(repl): maybe improve repl test flakiness on the CI (#23933) 2024-05-22 10:13:37 -04:00
wpt fix(ext/web): ReadableStream.from() ignores null Symbol.asyncIterator (#23910) 2024-05-23 13:55:07 +02:00
Cargo.toml feat(serve): support --port 0 to use an open port (#23846) 2024-05-17 05:38:50 +00:00
lib.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
README.md chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00

Deno Integration Tests