@@ -29,6 +29,7 @@ ok(EventTarget);
29
29
strictEqual ( ev . defaultPrevented , false ) ;
30
30
strictEqual ( typeof ev . timeStamp , 'number' ) ;
31
31
32
+ // Compatibility properties with the DOM
32
33
deepStrictEqual ( ev . composedPath ( ) , [ ] ) ;
33
34
strictEqual ( ev . returnValue , true ) ;
34
35
strictEqual ( ev . bubbles , false ) ;
@@ -59,7 +60,15 @@ ok(EventTarget);
59
60
ev . cancelBubble = 'some-truthy-value' ;
60
61
strictEqual ( ev . cancelBubble , true ) ;
61
62
}
62
-
63
+ {
64
+ // No argument behavior - throw TypeError
65
+ throws ( ( ) => {
66
+ new Event ( ) ;
67
+ } , TypeError ) ;
68
+ // Too many arguments passed behavior - ignore additional arguments
69
+ const ev = new Event ( 'foo' , { } , { } ) ;
70
+ strictEqual ( ev . type , 'foo' ) ;
71
+ }
63
72
{
64
73
const ev = new Event ( 'foo' , { cancelable : true } ) ;
65
74
strictEqual ( ev . type , 'foo' ) ;
@@ -419,6 +428,6 @@ ok(EventTarget);
419
428
{
420
429
const target = new EventTarget ( ) ;
421
430
strictEqual ( target . toString ( ) , '[object EventTarget]' ) ;
422
- const event = new Event ( ) ;
431
+ const event = new Event ( '' ) ;
423
432
strictEqual ( event . toString ( ) , '[object Event]' ) ;
424
433
}
0 commit comments