diff options
Diffstat (limited to 'deps/v8/test/mjsunit/es6/reflect-construct.js')
-rw-r--r-- | deps/v8/test/mjsunit/es6/reflect-construct.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/es6/reflect-construct.js b/deps/v8/test/mjsunit/es6/reflect-construct.js index 4661b4093b..9de5158005 100644 --- a/deps/v8/test/mjsunit/es6/reflect-construct.js +++ b/deps/v8/test/mjsunit/es6/reflect-construct.js @@ -17,6 +17,30 @@ })(); +(function testReflectConstructArg1NonConstructor() { + try { + Reflect.construct(() => {}, []); + } catch (e) { + assertInstanceof(e, TypeError); + assertEquals("() => {} is not a constructor", e.message); + return; + } + assertUnreachable("Exception expected"); +})(); + + +(function testReflectConstructArg3NonConstructor() { + try { + Reflect.construct(function() {}, [], () => {}); + } catch (e) { + assertInstanceof(e, TypeError); + assertEquals("() => {} is not a constructor", e.message); + return; + } + assertUnreachable("Exception expected"); +})(); + + (function testReflectConstructBasic() { function Constructor() { "use strict"; } assertInstanceof(Reflect.construct(Constructor, []), Constructor); |