Skip to content

Commit

Permalink
lib: event static properties non writable and configurable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BenzeneAlcohol committed Nov 1, 2023
1 parent ddf17fb commit c9a6c28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/event_target.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
ArrayFrom,
ArrayPrototypeReduce,
Boolean,
Error,
FunctionPrototypeCall,
Expand Down Expand Up @@ -353,7 +354,7 @@ const staticProps = ['NONE', 'CAPTURING_PHASE', 'AT_TARGET', 'BUBBLING_PHASE'];

ObjectDefineProperties(
Event,
staticProps.reduce((result, staticProp, index = 0) => {
ArrayPrototypeReduce(staticProps, (result, staticProp, index = 0) => {
result[staticProp] = {
__proto__: null,
writable: false,
Expand Down

0 comments on commit c9a6c28

Please sign in to comment.