-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
eventtargetIssues and PRs related to the EventTarget implementation.Issues and PRs related to the EventTarget implementation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
Description
Version
v22
Platform
n/a
Subsystem
events
What steps will reproduce the bug?
Event.NONE = 'lol'
Event.CAPTURING_PHASE = 'lol'
Event.AT_TARGET = 'lol'
Event.BUBBLING_PHASE = 'lol'
Event.NONE // 'lol', should be 0
Event.CAPTURING_PHASE // 'lol', should be 1
Event.AT_TARGET // 'lol', should be 2
Event.BUBBLING_PHASE // 'lol', should be 3
How often does it reproduce? Is there a required condition?
n/a
What is the expected behavior? Why is that the expected behavior?
The idl definition for Event makes these properties constants. That means that they shouldn't be configurable or writable.
const props = ['NONE', 'CAPTURING_PHASE', 'AT_TARGET', 'BUBBLING_PHASE']
for (const prop of props) {
const desc = Object.getOwnPropertyDescriptor(Event, prop)
assert.strictEqual(desc.writable, false)
assert.strictEqual(desc.configurable, false)
assert.strictEqual(desc.enumerable, true)
}
What do you see instead?
shown above
Additional information
take a look at how it's being done for prototypical methods/properties, but do that for Event with the properties mentioned above.
node/lib/internal/event_target.js
Line 324 in 6431c65
ObjectDefineProperties( |
Metadata
Metadata
Assignees
Labels
eventtargetIssues and PRs related to the EventTarget implementation.Issues and PRs related to the EventTarget implementation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.