Commit f5974f6 1 parent 6763932 commit f5974f6 Copy full SHA for f5974f6
File tree 2 files changed +18
-8
lines changed
2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,23 @@ class Event {
123
123
this [ kIsBeingDispatched ] = false ;
124
124
}
125
125
126
+ /**
127
+ * @param {string } type
128
+ * @param {boolean } [bubbles]
129
+ * @param {boolean } [cancelable]
130
+ */
131
+ initEvent ( type , bubbles = false , cancelable = false ) {
132
+ if ( arguments . length === 0 )
133
+ throw new ERR_MISSING_ARGS ( 'type' ) ;
134
+
135
+ if ( this [ kIsBeingDispatched ] ) {
136
+ return ;
137
+ }
138
+ this [ kType ] = `${ type } ` ;
139
+ this . #bubbles = ! ! bubbles ;
140
+ this . #cancelable = ! ! cancelable ;
141
+ }
142
+
126
143
[ customInspectSymbol ] ( depth , options ) {
127
144
if ( ! isEvent ( this ) )
128
145
throw new ERR_INVALID_THIS ( 'Event' ) ;
@@ -307,6 +324,7 @@ ObjectDefineProperties(
307
324
configurable : true ,
308
325
value : 'Event' ,
309
326
} ,
327
+ initEvent : kEnumerableProperty ,
310
328
stopImmediatePropagation : kEnumerableProperty ,
311
329
preventDefault : kEnumerableProperty ,
312
330
target : kEnumerableProperty ,
Original file line number Diff line number Diff line change 8
8
]
9
9
}
10
10
},
11
- "Event-constructors.any.js" : {
12
- "fail" : {
13
- "expected" : [
14
- " Untitled 2" ,
15
- " Untitled 3"
16
- ]
17
- }
18
- },
19
11
"Event-dispatch-listener-order.window.js" : {
20
12
"skip" : " document is not defined"
21
13
},
You can’t perform that action at this time.
0 commit comments