mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix(ext/webidl): change createPromiseConverter (#16367)
This commit is contained in:
parent
c3f7e6ed6e
commit
b0f13560cb
2 changed files with 13 additions and 27 deletions
|
@ -948,10 +948,12 @@ function createRecordConverter(keyConverter, valueConverter) {
|
||||||
|
|
||||||
function createPromiseConverter(converter) {
|
function createPromiseConverter(converter) {
|
||||||
return (V, prefix, context, opts) =>
|
return (V, prefix, context, opts) =>
|
||||||
PromisePrototypeThen(
|
// should be able to handle thenables
|
||||||
PromiseResolve(V),
|
// see: https://github.com/web-platform-tests/wpt/blob/a31d3ba53a79412793642366f3816c9a63f0cf57/streams/writable-streams/close.any.js#L207
|
||||||
(V) => converter(V, prefix, context, opts),
|
typeof V?.then === "function"
|
||||||
);
|
? PromisePrototypeThen(PromiseResolve(V), (V) =>
|
||||||
|
converter(V, prefix, context, opts))
|
||||||
|
: PromiseResolve(converter(V, prefix, context, opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
function invokeCallbackFunction(
|
function invokeCallbackFunction(
|
||||||
|
|
|
@ -1843,14 +1843,8 @@
|
||||||
"bad-buffers-and-views.any.worker.html": true,
|
"bad-buffers-and-views.any.worker.html": true,
|
||||||
"construct-byob-request.any.html": true,
|
"construct-byob-request.any.html": true,
|
||||||
"construct-byob-request.any.worker.html": true,
|
"construct-byob-request.any.worker.html": true,
|
||||||
"general.any.html": [
|
"general.any.html": true,
|
||||||
"ReadableStream with byte source: Respond to multiple pull() by separate enqueue()",
|
"general.any.worker.html": true,
|
||||||
"ReadableStream with byte source: enqueue() discards auto-allocated BYOB request"
|
|
||||||
],
|
|
||||||
"general.any.worker.html": [
|
|
||||||
"ReadableStream with byte source: Respond to multiple pull() by separate enqueue()",
|
|
||||||
"ReadableStream with byte source: enqueue() discards auto-allocated BYOB request"
|
|
||||||
],
|
|
||||||
"non-transferable-buffers.any.html": true,
|
"non-transferable-buffers.any.html": true,
|
||||||
"non-transferable-buffers.any.worker.html": true,
|
"non-transferable-buffers.any.worker.html": true,
|
||||||
"enqueue-with-detached-buffer.window.html": false,
|
"enqueue-with-detached-buffer.window.html": false,
|
||||||
|
@ -1862,10 +1856,7 @@
|
||||||
"enqueue-with-detached-buffer.any.worker.html": true
|
"enqueue-with-detached-buffer.any.worker.html": true
|
||||||
},
|
},
|
||||||
"readable-streams": {
|
"readable-streams": {
|
||||||
"async-iterator.any.html": [
|
"async-iterator.any.html": true,
|
||||||
"next() that succeeds; return()",
|
|
||||||
"next() that succeeds; return() [no awaiting]"
|
|
||||||
],
|
|
||||||
"bad-strategies.any.html": true,
|
"bad-strategies.any.html": true,
|
||||||
"bad-strategies.any.worker.html": true,
|
"bad-strategies.any.worker.html": true,
|
||||||
"bad-underlying-sources.any.html": true,
|
"bad-underlying-sources.any.html": true,
|
||||||
|
@ -1892,10 +1883,7 @@
|
||||||
"tee.any.worker.html": true,
|
"tee.any.worker.html": true,
|
||||||
"templated.any.html": true,
|
"templated.any.html": true,
|
||||||
"templated.any.worker.html": true,
|
"templated.any.worker.html": true,
|
||||||
"async-iterator.any.worker.html": [
|
"async-iterator.any.worker.html": true,
|
||||||
"next() that succeeds; return()",
|
|
||||||
"next() that succeeds; return() [no awaiting]"
|
|
||||||
],
|
|
||||||
"cross-realm-crash.window.html": false
|
"cross-realm-crash.window.html": false
|
||||||
},
|
},
|
||||||
"transform-streams": {
|
"transform-streams": {
|
||||||
|
@ -1929,12 +1917,8 @@
|
||||||
"bad-underlying-sinks.any.worker.html": true,
|
"bad-underlying-sinks.any.worker.html": true,
|
||||||
"byte-length-queuing-strategy.any.html": true,
|
"byte-length-queuing-strategy.any.html": true,
|
||||||
"byte-length-queuing-strategy.any.worker.html": true,
|
"byte-length-queuing-strategy.any.worker.html": true,
|
||||||
"close.any.html": [
|
"close.any.html": true,
|
||||||
"when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time"
|
"close.any.worker.html": true,
|
||||||
],
|
|
||||||
"close.any.worker.html": [
|
|
||||||
"when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time"
|
|
||||||
],
|
|
||||||
"constructor.any.html": true,
|
"constructor.any.html": true,
|
||||||
"constructor.any.worker.html": true,
|
"constructor.any.worker.html": true,
|
||||||
"count-queuing-strategy.any.html": true,
|
"count-queuing-strategy.any.html": true,
|
||||||
|
@ -9087,4 +9071,4 @@
|
||||||
"media-sniff.window.html": false
|
"media-sniff.window.html": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue