2
2
3
3
const {
4
4
ArrayFrom,
5
+ Boolean,
5
6
Error,
6
7
Map,
8
+ NumberIsInteger,
7
9
Object,
8
10
Set,
9
11
Symbol,
@@ -78,7 +80,7 @@ class Event {
78
80
return name ;
79
81
80
82
const opts = Object . assign ( { } , options , {
81
- dept : options . depth === null ? null : options . depth - 1
83
+ depth : NumberIsInteger ( options . depth ) ? options . depth - 1 : options . depth
82
84
} ) ;
83
85
84
86
return `${ name } ${ inspect ( {
@@ -294,7 +296,7 @@ class EventTarget {
294
296
this . #emitting. delete ( event . type ) ;
295
297
event [ kTarget ] = undefined ;
296
298
297
- return event . defaultPrevented === true ? false : true ;
299
+ return event . defaultPrevented !== true ;
298
300
}
299
301
300
302
[ customInspectSymbol ] ( depth , options ) {
@@ -303,7 +305,7 @@ class EventTarget {
303
305
return name ;
304
306
305
307
const opts = Object . assign ( { } , options , {
306
- dept : options . depth === null ? null : options . depth - 1
308
+ depth : NumberIsInteger ( options . depth ) ? options . depth - 1 : options . depth
307
309
} ) ;
308
310
309
311
return `${ name } ${ inspect ( { } , opts ) } ` ;
@@ -429,15 +431,10 @@ function validateEventListenerOptions(options) {
429
431
if ( typeof options === 'boolean' )
430
432
return { capture : options } ;
431
433
validateObject ( options , 'options' ) ;
432
- const {
433
- once = false ,
434
- capture = false ,
435
- passive = false ,
436
- } = options ;
437
434
return {
438
- once : ! ! once ,
439
- capture : ! ! capture ,
440
- passive : ! ! passive ,
435
+ once : Boolean ( options . once ) ,
436
+ capture : Boolean ( options . capture ) ,
437
+ passive : Boolean ( options . passive ) ,
441
438
} ;
442
439
}
443
440
0 commit comments