Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(958)

Unified Diff: test/mjsunit/es6/reflect-construct.js

Issue 2688393003: Fix TypeError message for Reflect.construct (Closed)
Patch Set: Fix order in runtime-internal.cc Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/reflect-construct.js
diff --git a/test/mjsunit/es6/reflect-construct.js b/test/mjsunit/es6/reflect-construct.js
index 4661b4093b3014a72b6153f45ab2b965c62bb283..9de515800531076ad7c59c57a8e921dedf25c08f 100644
--- a/test/mjsunit/es6/reflect-construct.js
+++ b/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);
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698