Skip to content

Conversation

@mscdex
Copy link
Contributor

Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • the commit message follows commit guidelines
Affected core subsystem(s)
  • events
Description of change

This commit safely allows event names that are named the same as properties that are ordinarily inherited from Object.prototype such as __proto__.

Fixes: #728

@mscdexmscdex added events Issues and PRs related to the events subsystem / EventEmitter. semver-major PRs that contain breaking changes and should be released in the next major version. labels Apr 7, 2016
@mscdexmscdexforce-pushed the events-empty-prototype branch from 8680b06 to 2cec8a1CompareApril 7, 2016 00:39
@mscdex
Copy link
ContributorAuthor

@mscdex
Copy link
ContributorAuthor

Also, there is no performance regression with this change 💃

@mscdexmscdex added this to the 6.0.0 milestone Apr 7, 2016
@thefourtheye
Copy link
Contributor

Can we make use of the test changes in #2350?

@mscdex
Copy link
ContributorAuthor

@thefourtheye The included tests should cover it I think

@evanlucas
Copy link
Contributor

@mscdex will this have any affect on process since it sets _events to a regular object?

@vkurchatkin
Copy link
Contributor

@evanlucas it makes sense to simply call EventEmitter on process

@mscdexmscdexforce-pushed the events-empty-prototype branch from 2cec8a1 to 3711c52CompareApril 7, 2016 13:06
@mscdex
Copy link
ContributorAuthor

@evanlucas
Copy link
Contributor

LGTM

src/node.cc Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this process._events?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yes.

@Fishrock123
Copy link
Contributor

Hmmm, can this be back-ported? Theoretically, this could be considered a security issue for unvalidated input.

@mscdex
Copy link
ContributorAuthor

@Fishrock123 It's definitely a semver-major change, but I don't recall how that plays out with backporting/LTS/etc.

@mscdexmscdex mentioned this pull request Apr 7, 2016
3 tasks
@mscdex
Copy link
ContributorAuthor

@jasnell
Copy link
Member

I don't believe back porting would be possible to v4. It might be safe to get into v5 tho.

@jasnell
Copy link
Member

LGTM

@mscdex
Copy link
ContributorAuthor

CI is green except for a flaky test and citgm is green.

@mscdex
Copy link
ContributorAuthor

CI again one last time: https://ci.nodejs.org/job/node-test-pull-request/2305/

@jasnell
Copy link
Member

Still LGTM

This commit safely allows event names that are named the same as properties that are ordinarily inherited from Object.prototype such as __proto__. Fixes: nodejs#728 PR-URL: nodejs#6092 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
@mscdexmscdexforce-pushed the events-empty-prototype branch from 3711c52 to e38badeCompareApril 19, 2016 01:47
@mscdexmscdex merged commit e38bade into nodejs:masterApr 19, 2016
@mscdexmscdex deleted the events-empty-prototype branch April 19, 2016 01:49
@Fishrock123
Copy link
Contributor

iirc usually we don't care about warnings

@jasnell
Copy link
Member

Typically, but it's nice to avoid them when possible to do so, no?

@Fishrock123
Copy link
Contributor

Fishrock123 commented Apr 19, 2016

I guess, just consider though, that there are tons of warnings of the same and there isn't necessarily easy ways to avoid it.

thefourtheye added a commit to thefourtheye/io.js that referenced this pull request Apr 19, 2016
This patch fixes the warning introduced by the changes in e38bade. Ref: nodejs#6092
thefourtheye added a commit that referenced this pull request Apr 19, 2016
This patch fixes the warning introduced by the changes in e38bade. Ref: #6092 PR-URL: #6276 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
joelostrowski pushed a commit to joelostrowski/node that referenced this pull request Apr 25, 2016
This commit safely allows event names that are named the same as properties that are ordinarily inherited from Object.prototype such as __proto__. Fixes: nodejs#728 PR-URL: nodejs#6092 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
joelostrowski pushed a commit to joelostrowski/node that referenced this pull request Apr 25, 2016
This patch fixes the warning introduced by the changes in e38bade. Ref: nodejs#6092 PR-URL: nodejs#6276 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
jasnell pushed a commit that referenced this pull request Apr 26, 2016
This commit safely allows event names that are named the same as properties that are ordinarily inherited from Object.prototype such as __proto__. Fixes: #728 PR-URL: #6092 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
jasnell pushed a commit that referenced this pull request Apr 26, 2016
This patch fixes the warning introduced by the changes in e38bade. Ref: #6092 PR-URL: #6276 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
@BridgeARBridgeAR mentioned this pull request Apr 1, 2019
2 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eventsIssues and PRs related to the events subsystem / EventEmitter.semver-majorPRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@mscdex@thefourtheye@evanlucas@vkurchatkin@Fishrock123@jasnell@addaleax