| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
If the transfer list argument is present, it should be an array. This commit adds typechecking to that effect. This aligns behaviour with browsers.
There was a problem hiding this comment.
LGTM if CI is green
Sorry, something went wrong.
| if (!args[1]->IsNullOrUndefined() && !args[1]->IsObject()) { | ||
| // Browsers also do not throw on `null` or objects, although it really | ||
| // should be an array or undefined, thus the mismatch between the checks | ||
| // above and the actual error message. |
There was a problem hiding this comment.
The reason for this is due to the fact that browsers have an overload that accepts an option bag in addition to just a transfer list. See https://html.spec.whatwg.org/multipage/web-messaging.html#messageport. How browsers resolve the overloading is roughly something like this
Sorry, something went wrong.
There was a problem hiding this comment.
@TimothyGu I’m adding a TODO comment in this PR and merge this with the current state, if that’s okay with you
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah sure. You might encounter it as we try to pass more WPTs, so hope it'd be helpful.
Sorry, something went wrong.
Co-Authored-By: Rich Trott <rtrott@gmail.com>
Sorry, something went wrong.
If the transfer list argument is present, it should be an array. This commit adds typechecking to that effect. This aligns behaviour with browsers. PR-URL: #28033 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
If the transfer list argument is present, it should be an array. This commit adds typechecking to that effect. This aligns behaviour with browsers. PR-URL: #28033 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Allow generic iterables as transfer list arguments, as well as an options object with a `transfer` option, for web compatibility. Refs: nodejs#28033 (comment)
Allow generic iterables as transfer list arguments, as well as an options object with a `transfer` option, for web compatibility. PR-URL: #29319 Refs: #28033 (comment) Reviewed-By: James M Snell <jasnell@gmail.com>
Allow generic iterables as transfer list arguments, as well as an options object with a `transfer` option, for web compatibility. PR-URL: #29319 Refs: #28033 (comment) Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
If the transfer list argument is present, it should be an array.
This commit adds typechecking to that effect. This aligns behaviour
with browsers.
I’m also more than happy to label this semver-major.
Checklist