Skip to content

lib: fix WebIDL object and dictionary type conversion - #37047

Merged
Trott merged 0 commit into
nodejs:masterfrom
ExE-Boss:lib/use-correct-webidl-object-conversion
Feb 9, 2021
Merged

lib: fix WebIDL object and dictionary type conversion#37047
Trott merged 0 commit into
nodejs:masterfrom
ExE-Boss:lib/use-correct-webidl-object-conversion

Conversation

@ExE-Boss

Copy link
Copy Markdown
Contributor

The WebIDLobject, record<KV>, and Dictionary type conversion algorithm implicitly allows Arrays and Functions:


This is also necessary to prevent #37028 from being a breaking change.

@nodejs-github-botnodejs-github-bot added the crypto Issues and PRs related to the crypto subsystem. label Jan 24, 2021
Comment threadlib/internal/event_target.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For performance reasons, It's likely better to introduce a separate validator function for this.

@aduh95

Copy link
Copy Markdown
Contributor

So, should we run a benchmark CI for this, and which one?

@joyeecheung

Copy link
Copy Markdown
Member

So, should we run a benchmark CI for this, and which one?

I think the benchmark/events/eventtarget.js is one you are looking for?

@aduh95

Copy link
Copy Markdown
Contributor

@aduh95

Copy link
Copy Markdown
Contributor

Benchmark results are OK:

 confidence improvement accuracy (*) (**) (***)
events/eventtarget.jslisteners=10 n=1000000 -1.05 % ±4.82% ±6.42% ±8.37%
events/eventtarget.jslisteners=1 n=1000000 -1.17 % ±2.20% ±2.93% ±3.83%
events/eventtarget.jslisteners=5 n=1000000 0.38 % ±4.03% ±5.40% ±7.11%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 3 comparisons, you can thus
expect the following amount of false-positive results:
0.15 false positives, when considering a 5% risk acceptance (*, **, ***),
0.03 false positives, when considering a 1% risk acceptance (**, ***),
0.00 false positives, when considering a 0.1% risk acceptance (***)

Comment threadlib/internal/event_target.js Outdated
Comment on lines 88 to 90

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't you pass nullable: true instead of having a if (options !== null)?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Right, this became possible when #35806 made options default to null.

@ExE-Boss
ExE-Bossforce-pushed the lib/use-correct-webidl-object-conversion branch from 9ee498a to b6eb2bdCompareFebruary 5, 2021 12:01
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@ExE-Boss
ExE-Bossforce-pushed the lib/use-correct-webidl-object-conversion branch from 4762372 to b6eb2bdCompareFebruary 5, 2021 12:47
@ExE-Boss
ExE-Boss requested a review from jasnellFebruary 5, 2021 13:03
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. review wanted PRs that need reviews. labels Feb 5, 2021
@ExE-Boss

ExE-Boss commented Feb 6, 2021

Copy link
Copy Markdown
ContributorAuthor

The PR labels should probably include the events label or the eventtarget label.

@aduh95aduh95 added events Issues and PRs related to the events subsystem / EventEmitter. eventtarget Issues and PRs related to the EventTarget implementation. labels Feb 6, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Trott commented Feb 9, 2021

Copy link
Copy Markdown
Member

Landed in beee538

@TrottTrott closed this Feb 9, 2021
@Trott
Trottforce-pushed the lib/use-correct-webidl-object-conversion branch from b6eb2bd to beee538CompareFebruary 9, 2021 01:03
@Trott
Trott merged commit beee538 into nodejs:masterFeb 9, 2021
@ExE-Boss
ExE-Boss deleted the lib/use-correct-webidl-object-conversion branch February 9, 2021 02:49
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
PR-URL: #37047
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This was referenced Feb 16, 2021
targos pushed a commit that referenced this pull request May 27, 2021
PR-URL: #37047
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request May 30, 2021
PR-URL: #37047
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
PR-URL: #37047
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@targostargos mentioned this pull request Jun 6, 2021
targos pushed a commit that referenced this pull request Jun 11, 2021
PR-URL: #37047
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.cryptoIssues and PRs related to the crypto subsystem.eventsIssues and PRs related to the events subsystem / EventEmitter.eventtargetIssues and PRs related to the EventTarget implementation.review wantedPRs that need reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@ExE-Boss@aduh95@joyeecheung@nodejs-github-bot@Trott@jasnell