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

Unified Diff: test/mjsunit/harmony/block-conflicts-sloppy.js

Issue 1286923002: Add class to existing lexical scoping tests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test bug Created 5 years, 4 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 | « test/mjsunit/es6/block-scoping.js ('k') | test/mjsunit/harmony/block-let-declaration-sloppy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/block-conflicts-sloppy.js
diff --git a/test/mjsunit/harmony/block-conflicts-sloppy.js b/test/mjsunit/harmony/block-conflicts-sloppy.js
index 9569c24ad4d60092f69ed73c2d9d18aede7eb196..8b9e0d235dd45aeda9706192116f85ab1e619748 100644
--- a/test/mjsunit/harmony/block-conflicts-sloppy.js
+++ b/test/mjsunit/harmony/block-conflicts-sloppy.js
@@ -81,7 +81,11 @@ var letbinds = [ "let x;",
"const x = function() {};",
"const x = 2, y = 3;",
"const y = 4, x = 5;",
+ "class x { }",
];
+function forCompatible(bind) {
+ return !bind.startsWith('class');
+}
var varbinds = [ "var x;",
"var x = 0;",
"var x = undefined;",
@@ -103,7 +107,9 @@ for (var l = 0; l < letbinds.length; ++l) {
TestNoConflict(varbinds[v] + '{' + letbinds[l] + '}');
TestNoConflict('{' + letbinds[l] + '}' + varbinds[v]);
// For loop.
- TestConflict('for (' + letbinds[l] + '0;) {' + varbinds[v] + '}');
+ if (forCompatible(letbinds[l])) {
+ TestConflict('for (' + letbinds[l] + '0;) {' + varbinds[v] + '}');
+ }
TestNoConflict('for (' + varbinds[v] + '0;) {' + letbinds[l] + '}');
}
@@ -116,8 +122,12 @@ for (var l = 0; l < letbinds.length; ++l) {
TestNoConflict(letbinds[l] + '{ ' + letbinds[k] + '}');
TestNoConflict('{' + letbinds[k] +'} ' + letbinds[l]);
// For loop.
- TestNoConflict('for (' + letbinds[l] + '0;) {' + letbinds[k] + '}');
- TestNoConflict('for (' + letbinds[k] + '0;) {' + letbinds[l] + '}');
+ if (forCompatible(letbinds[l])) {
+ TestNoConflict('for (' + letbinds[l] + '0;) {' + letbinds[k] + '}');
+ }
+ if (forCompatible(letbinds[k])) {
+ TestNoConflict('for (' + letbinds[k] + '0;) {' + letbinds[l] + '}');
+ }
}
// Test conflicting function/let bindings.
@@ -130,7 +140,9 @@ for (var l = 0; l < letbinds.length; ++l) {
TestNoConflict(funbind + '{' + letbinds[l] + '}');
TestNoConflict('{' + letbinds[l] + '}' + funbind);
// For loop.
- TestNoConflict('for (' + letbinds[l] + '0;) {' + funbind + '}');
+ if (forCompatible(letbinds[l])) {
+ TestNoConflict('for (' + letbinds[l] + '0;) {' + funbind + '}');
+ }
// Test conflicting parameter/let bindings.
TestConflict('(function(x) {' + letbinds[l] + '})();');
« no previous file with comments | « test/mjsunit/es6/block-scoping.js ('k') | test/mjsunit/harmony/block-let-declaration-sloppy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698