FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: make structuredClone spec compliant by VoltrexKeyva · Pull Request #40251 · nodejs/node · GitHub

/ node Public

lib: make structuredClone spec compliant - #40251

Closed
VoltrexKeyva wants to merge 1 commit into
nodejs:masterfrom
VoltrexKeyva:fix-structuredclone
Closed

lib: make structuredClone spec compliant#40251
VoltrexKeyva wants to merge 1 commit into
nodejs:masterfrom
VoltrexKeyva:fix-structuredclone

Conversation

Copy link
Copy Markdown
Contributor

Fixes: #40246

nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 29, 2021

targos commented Sep 29, 2021

Copy link
Copy Markdown
Member

It would be nice to have a WPT for this.

targos commented Sep 29, 2021

Copy link
Copy Markdown
Member

BTW, I'm not sure we should throw an error, but instead just grab transfer from the passed object and create a new options object with it.

Copy link
Copy Markdown
Contributor Author

BTW, I'm not sure we should throw an error, but instead just grab transfer from the passed object and create a new options object with it.

We mostly just throw an error if the passed value is not spec complaint in most cases, throwing an error here would be nice for keeping consistency unless there's a special case where we have to avoid throwing an error.

targos commented Sep 29, 2021

Copy link
Copy Markdown
Member

What's important here is not consistency, but spec compliance. The spec just asks to pass options["transfer"]. Maybe I'm wrong, but I understand that it should not be an error to do this:

const options = [];
options.transfer = [toTransfer];
structuredClone({}, options);

Comment thread lib/internal/structured_clone.js Outdated

targos commented Sep 29, 2021

Copy link
Copy Markdown
Member

Do we have a WHATWG spec specialist that we could ping to take a look?

aduh95 commented Sep 29, 2021

Copy link
Copy Markdown
Contributor

Maybe @surma would be available to review this, since they are the one who proposed this API to WHATWG.

aduh95 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 3, 2021
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 3, 2021

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 3, 2021
github-actions Bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 3, 2021

github-actions Bot commented Oct 3, 2021

Copy link
Copy Markdown
Contributor

Landed in 6199441...3d11baf

github-actions Bot closed this Oct 3, 2021
nodejs-github-bot pushed a commit that referenced this pull request Oct 3, 2021
Fixes: #40246

PR-URL: #40251
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
VoltrexKeyva deleted the fix-structuredclone branch October 3, 2021 15:25
danielleadams pushed a commit that referenced this pull request Oct 4, 2021
Fixes: #40246

PR-URL: #40251
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Oct 4, 2021
Fixes: #40246

PR-URL: #40251
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Oct 5, 2021
Fixes: #40246

PR-URL: #40251
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid globalThis.structuredClone interface

7 participants


Back | FazBrowse Home | New Git URL