Skip to content

events: expose Event statics - #33649

Closed
benjamingr wants to merge 3 commits into
nodejs:masterfrom
benjamingr:event-statics
Closed

events: expose Event statics#33649
benjamingr wants to merge 3 commits into
nodejs:masterfrom
benjamingr:event-statics

Conversation

@benjamingr

@benjamingrbenjamingr commented May 30, 2020

Copy link
Copy Markdown
Member

Expose Event statics (Event.NONE etc). See Event phase constants.

  • Chrome, Firefox, Edge, and Safari implement these.
  • IE11 implements all of these except NONE (for some reason).

I think these are required on the event interface (as constants).

They are as-enumerable as they are in browsers though I did not add a specific test for enumerability (I can if people feel strongly about it)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@benjamingrbenjamingr added the events Issues and PRs related to the events subsystem / EventEmitter. label May 30, 2020
@benjamingr

Copy link
Copy Markdown
MemberAuthor

Also I did not fix the tests at the top that check eventPhase with the numeric values (rather than constants) to not create coupling, but I can happily change that.

@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 30, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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.

Adding a comment in here that we currently do not use the CAPTURING_PHASE and BUBBLING_PHASE but that they need to be preserved anyway because of the spec would be good.

@BridgeAR
BridgeARforce-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72CompareMay 31, 2020 12:18
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment threadtest/parallel/test-eventtarget.js Outdated
@jasnelljasnell added eventtarget Issues and PRs related to the EventTarget implementation. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Jun 19, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@jasnell

Copy link
Copy Markdown
Member

Adding a fixup commit resolving the rebase conflict.

@jasnell

Copy link
Copy Markdown
Member

@benjamingr ... can I ask to you squash the commits here?

@benjamingr

Copy link
Copy Markdown
MemberAuthor

Sure though I have a computer without built node so I am doing everything "blind" until early next week.

@benjamingr

Copy link
Copy Markdown
MemberAuthor

@jasnell I see there is a merge commit present - I assume that's not intentional? Can I pluck it out and squash the other two?

@jasnell

Copy link
Copy Markdown
Member

Actually, don't worry about squashing or fixing up. I'm combining all these PRs into a single PR to make landing them easier

@benjamingr

Copy link
Copy Markdown
MemberAuthor

@jasnell to be explicit, you have my explicit consent (and blessing) to do as you wish with the code here and in the other PRs (and in follow up event-target PRs when I get back to my workstation next week).

@jasnell

Copy link
Copy Markdown
Member

Closing in favor of #34015 (which combines this and other eventtarget PRs into a single to make landing easier

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.eventtargetIssues and PRs related to the EventTarget implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@benjamingr@nodejs-github-bot@jasnell@targos@BridgeAR