Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: static properties are configurable & writable #50417

Closed
KhafraDev opened this issue Oct 26, 2023 · 1 comment · Fixed by #50425
Closed

events: static properties are configurable & writable #50417

KhafraDev opened this issue Oct 26, 2023 · 1 comment · Fixed by #50425
Labels
eventtarget Issues and PRs related to the EventTarget implementation. good first issue Issues that are suitable for first-time contributors.

Comments

@KhafraDev
Copy link
Member

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.

ObjectDefineProperties(

@KhafraDev KhafraDev added good first issue Issues that are suitable for first-time contributors. eventtarget Issues and PRs related to the EventTarget implementation. labels Oct 26, 2023
@alfonsograziano
Copy link

Not sure if someone is already working on it actively, but I'm taking a look :)

BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Oct 27, 2023
The idl definition for Event makes the properties constants, this means
that they shouldn't be configurable. However, they were, and this commit
fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Oct 27, 2023
The idl definition for Event makes the properties constants
this means that they shouldn't be configurable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Oct 30, 2023
The idl definition for Event makes the properties constants
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Oct 30, 2023
The idl definition for Event makes the properties constants
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Nov 1, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Nov 1, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Nov 1, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Nov 1, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Nov 2, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
BenzeneAlcohol added a commit to BenzeneAlcohol/node that referenced this issue Nov 3, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: nodejs#50417
nodejs-github-bot pushed a commit that referenced this issue Nov 10, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: #50417
PR-URL: #50425
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
targos pushed a commit that referenced this issue Nov 11, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: #50417
PR-URL: #50425
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
targos pushed a commit that referenced this issue Nov 14, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: #50417
PR-URL: #50425
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
UlisesGascon pushed a commit that referenced this issue Dec 11, 2023
The idl definition for Event makes the properties constant
this means that they shouldn't be configurable and writable.
However, they were, and this commit fixes that.

Fixes: #50417
PR-URL: #50425
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eventtarget Issues and PRs related to the EventTarget implementation. good first issue Issues that are suitable for first-time contributors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants