File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22const webidlWrapper = require ( './webidl2js-wrapper.js' ) ;
3- const webidlConversions = require ( 'webidl-conversions' ) ;
43
54const sharedGlobalObject = { } ;
65webidlWrapper . install ( sharedGlobalObject ) ;
@@ -14,13 +13,11 @@ const origCSSStyleDeclaration = sharedGlobalObject.CSSStyleDeclaration;
1413 */
1514function CSSStyleDeclaration ( onChangeCallback = null ) {
1615 if ( new . target === undefined ) {
17- throw new TypeError ( 'Illegal invocation' ) ;
16+ throw new TypeError ( "Class constructor CSSStyleDeclaration cannot be invoked without 'new'" ) ;
1817 }
1918
20- if ( onChangeCallback !== null ) {
21- onChangeCallback = webidlConversions . Function ( onChangeCallback , {
22- context : 'Failed to constructor CSSStyleDeclaration: parameter 1' ,
23- } ) ;
19+ if ( onChangeCallback !== null && typeof onChangeCallback !== 'function' ) {
20+ throw new TypeError ( 'Failed to constructor CSSStyleDeclaration: parameter 1 is not a function' ) ;
2421 }
2522
2623 return webidlWrapper . create ( sharedGlobalObject , undefined , { onChangeCallback } ) ;
You can’t perform that action at this time.
0 commit comments