Skip to content

fix(ext/web): ReadableStream.from() ignores null Symbol.asyncIterator #23910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/web/06_streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -5096,16 +5096,16 @@ async function* createAsyncFromSyncIterator(syncIterator) {
// Ref: https://tc39.es/ecma262/#sec-getiterator
function getIterator(obj, async = false) {
if (async) {
if (obj[SymbolAsyncIterator] === undefined) {
if (obj[SymbolIterator] === undefined) {
if (obj[SymbolAsyncIterator] == null) {
if (obj[SymbolIterator] == null) {
throw new TypeError("No iterator found");
}
return createAsyncFromSyncIterator(obj[SymbolIterator]());
} else {
return obj[SymbolAsyncIterator]();
}
} else {
if (obj[SymbolIterator] === undefined) {
if (obj[SymbolIterator] == null) {
throw new TypeError("No iterator found");
}
return obj[SymbolIterator]();
Expand Down
17 changes: 14 additions & 3 deletions tests/wpt/runner/expectation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3170,8 +3170,14 @@
"owning-type-message-port.any.worker.html": false,
"owning-type.any.html": false,
"owning-type.any.worker.html": false,
"from.any.html": true,
"from.any.worker.html": true
"from.any.html": [
"ReadableStream.from accepts a sync iterable of values",
"ReadableStream.from accepts a sync iterable of promises"
Comment on lines +3174 to +3175
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be fixed by #23903.

],
"from.any.worker.html": [
"ReadableStream.from accepts a sync iterable of values",
"ReadableStream.from accepts a sync iterable of promises"
]
},
"transform-streams": {
"backpressure.any.html": true,
Expand Down Expand Up @@ -10072,7 +10078,6 @@
"Worker-replace-event-handler.any.worker.html": true,
"Worker-replace-global-constructor.any.worker.html": true,
"Worker-replace-self.any.worker.html": true,
"WorkerGlobalScope_requestAnimationFrame.tentative.worker.html": false,
"WorkerLocation-origin.sub.window.html": false,
"WorkerNavigator-hardware-concurrency.any.worker.html": true,
"WorkerNavigator.any.worker.html": false,
Expand Down Expand Up @@ -10753,6 +10758,9 @@
},
"service-workers": {
"idlharness.https.any.html": [
"ServiceWorkerContainer interface: operation register((TrustedScriptURL or USVString), optional RegistrationOptions)",
"ServiceWorkerContainer interface: navigator.serviceWorker must inherit property \"register((TrustedScriptURL or USVString), optional RegistrationOptions)\" with the proper type",
"ServiceWorkerContainer interface: calling register((TrustedScriptURL or USVString), optional RegistrationOptions) on navigator.serviceWorker with too few arguments must throw TypeError",
"ServiceWorker interface: existence and properties of interface object",
"ServiceWorker interface object length",
"ServiceWorker interface object name",
Expand Down Expand Up @@ -10861,6 +10869,9 @@
"idl_test setup"
],
"idlharness.https.any.worker.html": [
"ServiceWorkerContainer interface: operation register((TrustedScriptURL or USVString), optional RegistrationOptions)",
"ServiceWorkerContainer interface: navigator.serviceWorker must inherit property \"register((TrustedScriptURL or USVString), optional RegistrationOptions)\" with the proper type",
"ServiceWorkerContainer interface: calling register((TrustedScriptURL or USVString), optional RegistrationOptions) on navigator.serviceWorker with too few arguments must throw TypeError",
"ServiceWorker interface: existence and properties of interface object",
"ServiceWorker interface object length",
"ServiceWorker interface object name",
Expand Down
2 changes: 1 addition & 1 deletion tests/wpt/suite
Submodule suite updated 338 files