Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a9675a0

Browse filesBrowse files
jazellytargos
authored andcommitted
stream: treat null asyncIterator as undefined
According to the spec, getIterator should normalize incoming method to undefined if it is either undefined or null. This PR enforces that spec compliance with passed WPT. PR-URL: #55119 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com>
1 parent 0fb446e commit a9675a0
Copy full SHA for a9675a0

File tree

Expand file treeCollapse file tree

2 files changed

+2
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-8
lines changed
Open diff view settings
Collapse file

‎lib/internal/webstreams/util.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/util.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,12 @@ function createAsyncFromSyncIterator(syncIteratorRecord) {
211211
return { iterator: asyncIterator, nextMethod, done: false };
212212
}
213213

214+
// Refs: https://tc39.es/ecma262/#sec-getiterator
214215
function getIterator(obj, kind = 'sync', method) {
215216
if (method === undefined) {
216217
if (kind === 'async') {
217218
method = obj[SymbolAsyncIterator];
218-
if (method === undefined) {
219+
if (method == null) {
219220
const syncMethod = obj[SymbolIterator];
220221

221222
if (syncMethod === undefined) {
Collapse file

‎test/wpt/status/streams.json‎

Copy file name to clipboardExpand all lines: test/wpt/status/streams.json
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@
1616
"readable-streams/cross-realm-crash.window.js": {
1717
"skip": "Browser-specific test"
1818
},
19-
"readable-streams/from.any.js": {
20-
"fail": {
21-
"expected": [
22-
"ReadableStream.from ignores a null @@asyncIterator"
23-
]
24-
}
25-
},
2619
"readable-streams/owning-type-message-port.any.js": {
2720
"fail": {
2821
"note": "Readable streams with type owning are not yet supported",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.