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

Unified Diff: test/mjsunit/harmony/classes.js

Issue 749633002: harmony-scoping: make assignment to 'const' a late error. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment update Created 6 years, 1 month 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 | « test/mjsunit/harmony/block-const-assign.js ('k') | test/mjsunit/harmony/module-linking.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/classes.js
diff --git a/test/mjsunit/harmony/classes.js b/test/mjsunit/harmony/classes.js
index 416c9114b530aa9065c2f8402de03c9ca78f8f7c..42917704a5b3430e02cf214f8a9b673ee0426a84 100644
--- a/test/mjsunit/harmony/classes.js
+++ b/test/mjsunit/harmony/classes.js
@@ -683,14 +683,14 @@ function assertAccessorDescriptor(object, name) {
(function TestNameBindingConst() {
- assertThrows('class C { constructor() { C = 42; } }', SyntaxError);
- assertThrows('(class C { constructor() { C = 42; } })', SyntaxError);
- assertThrows('class C { m() { C = 42; } }', SyntaxError);
- assertThrows('(class C { m() { C = 42; } })', SyntaxError);
- assertThrows('class C { get x() { C = 42; } }', SyntaxError);
- assertThrows('(class C { get x() { C = 42; } })', SyntaxError);
- assertThrows('class C { set x(_) { C = 42; } }', SyntaxError);
- assertThrows('(class C { set x(_) { C = 42; } })', SyntaxError);
+ assertThrows('class C { constructor() { C = 42; } }; new C();', TypeError);
+ assertThrows('new (class C { constructor() { C = 42; } })', TypeError);
+ assertThrows('class C { m() { C = 42; } }; new C().m()', TypeError);
+ assertThrows('new (class C { m() { C = 42; } }).m()', TypeError);
+ assertThrows('class C { get x() { C = 42; } }; new C().x', TypeError);
+ assertThrows('(new (class C { get x() { C = 42; } })).x', TypeError);
+ assertThrows('class C { set x(_) { C = 42; } }; new C().x = 15;', TypeError);
+ assertThrows('(new (class C { set x(_) { C = 42; } })).x = 15;', TypeError);
})();
« no previous file with comments | « test/mjsunit/harmony/block-const-assign.js ('k') | test/mjsunit/harmony/module-linking.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698