lib: fix WebIDL object and dictionary type conversion#37047
Merged
Trott merged 0 commit intonodejs:masterfrom Feb 9, 2021
Merged
lib: fix WebIDL object and dictionary type conversion#37047Trott merged 0 commit intonodejs:masterfrom
object and dictionary type conversion#37047Trott merged 0 commit intonodejs:masterfrom
Conversation
jasnell
reviewed
Jan 25, 2021
lib/internal/event_target.js
Outdated
| throw new ERR_MISSING_ARGS('type'); | ||
| if (options !== null) | ||
| validateObject(options, 'options'); | ||
| validateObject(options, 'options', { |
Member
There was a problem hiding this comment.
For performance reasons, It's likely better to introduce a separate validator function for this.
Contributor
|
So, should we run a benchmark CI for this, and which one? |
Member
I think the benchmark/events/eventtarget.js is one you are looking for? |
Contributor
Contributor
|
Benchmark results are OK: |
aduh95
reviewed
Feb 5, 2021
lib/internal/event_target.js
Outdated
Comment on lines
88
to
90
| if (options !== null) | ||
| validateObject(options, 'options'); | ||
| validateObject(options, 'options', { | ||
| allowArray: true, allowFunction: true, |
Contributor
There was a problem hiding this comment.
Shouldn't you pass nullable: true instead of having a if (options !== null)?
Contributor
Author
There was a problem hiding this comment.
Right, this became possible when #35806 made options default to null.
9ee498a to
b6eb2bd
Compare
aduh95
approved these changes
Feb 5, 2021
4762372 to
b6eb2bd
Compare
Contributor
Author
|
The PR labels should probably include the events label or the eventtarget label. |
joyeecheung
approved these changes
Feb 8, 2021
Trott
approved these changes
Feb 9, 2021
Member
|
Landed in beee538 |
b6eb2bd to
beee538
Compare
danielleadams
pushed a commit
that referenced
this pull request
Feb 16, 2021
PR-URL: #37047 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]>
targos
pushed a commit
that referenced
this pull request
May 27, 2021
PR-URL: #37047 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]>
targos
pushed a commit
that referenced
this pull request
May 30, 2021
PR-URL: #37047 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]>
targos
pushed a commit
that referenced
this pull request
Jun 5, 2021
PR-URL: #37047 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]>
targos
pushed a commit
that referenced
this pull request
Jun 11, 2021
PR-URL: #37047 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The WebIDL
object,record<K, V>, and Dictionary type conversion algorithm implicitly allows Arrays and Functions:This is also necessary to prevent #37028 from being a breaking change.