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

Unified Diff: test/mjsunit/strong/declaration-after-use.js

Issue 1087543004: [strong] Allow mutually recursive classes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 5 years, 8 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/variables.h ('k') | test/mjsunit/strong/mutually-recursive-classes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/strong/declaration-after-use.js
diff --git a/test/mjsunit/strong/declaration-after-use.js b/test/mjsunit/strong/declaration-after-use.js
index 3f5039249bad827c4ac2405892957b6aeee9e9cd..020067c1e5aa3c56d8da5e58788235a868b987ac 100644
--- a/test/mjsunit/strong/declaration-after-use.js
+++ b/test/mjsunit/strong/declaration-after-use.js
@@ -33,6 +33,10 @@ function assertThrowsHelper(code) {
assertThrowsHelper("function f() { x; let x = 0; }");
assertThrowsHelper("function f() { x; } let x = 0;");
+ assertThrowsHelper("x; const x = 0;");
+ assertThrowsHelper("function f() { x; const x = 0; }");
+ assertThrowsHelper("function f() { x; } const x = 0;");
+
// These tests needs to be done a bit more manually, since var is not allowed
// in strong mode:
assertThrows(
@@ -78,6 +82,16 @@ function assertThrowsHelper(code) {
(function DeclarationAfterUseInClasses() {
+ // Referring to a variable declared later
+ assertThrowsHelper("class C { m() { x; } } let x = 0;");
+ assertThrowsHelper("class C { static m() { x; } } let x = 0;");
+ assertThrowsHelper("class C { [x]() { } } let x = 0;");
+
+ assertThrowsHelper("class C { m() { x; } } const x = 0;");
+ assertThrowsHelper("class C { static m() { x; } } const x = 0;");
+ assertThrowsHelper("class C { [x]() { } } const x = 0;");
+
+ // Referring to the class name.
assertThrowsHelper("class C extends C { }");
assertThrowsHelper("let C = class C2 extends C { }");
assertThrowsHelper("let C = class C2 extends C2 { }");
« no previous file with comments | « src/variables.h ('k') | test/mjsunit/strong/mutually-recursive-classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698