@@ -29,6 +29,7 @@ ok(EventTarget);
2929 strictEqual ( ev . defaultPrevented , false ) ;
3030 strictEqual ( typeof ev . timeStamp , 'number' ) ;
3131
32+ // Compatibility properties with the DOM
3233 deepStrictEqual ( ev . composedPath ( ) , [ ] ) ;
3334 strictEqual ( ev . returnValue , true ) ;
3435 strictEqual ( ev . bubbles , false ) ;
@@ -59,7 +60,15 @@ ok(EventTarget);
5960 ev . cancelBubble = 'some-truthy-value' ;
6061 strictEqual ( ev . cancelBubble , true ) ;
6162}
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+ }
6372{
6473 const ev = new Event ( 'foo' , { cancelable : true } ) ;
6574 strictEqual ( ev . type , 'foo' ) ;
@@ -419,6 +428,6 @@ ok(EventTarget);
419428{
420429 const target = new EventTarget ( ) ;
421430 strictEqual ( target . toString ( ) , '[object EventTarget]' ) ;
422- const event = new Event ( ) ;
431+ const event = new Event ( '' ) ;
423432 strictEqual ( event . toString ( ) , '[object Event]' ) ;
424433}
0 commit comments