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 f10d9ad

Browse filesBrowse files
jazellymarco-ippolito
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 81bcec0 commit f10d9ad
Copy full SHA for f10d9ad

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
@@ -230,11 +230,12 @@ function createAsyncFromSyncIterator(syncIteratorRecord) {
230230
return { iterator: asyncIterator, nextMethod, done: false };
231231
}
232232

233+
// Refs: https://tc39.es/ecma262/#sec-getiterator
233234
function getIterator(obj, kind = 'sync', method) {
234235
if (method === undefined) {
235236
if (kind === 'async') {
236237
method = obj[SymbolAsyncIterator];
237-
if (method === undefined) {
238+
if (method == null) {
238239
const syncMethod = obj[SymbolIterator];
239240

240241
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.