Index: test/mjsunit/harmony/block-non-strict-errors.js |
diff --git a/test/mjsunit/harmony/block-non-strict-errors.js b/test/mjsunit/harmony/block-non-strict-errors.js |
index de27cd269fc1241b06b77f40b3abcff2809db824..e0da9ba03253cfaae6b5cabe5be5d3e79cfe680f 100644 |
--- a/test/mjsunit/harmony/block-non-strict-errors.js |
+++ b/test/mjsunit/harmony/block-non-strict-errors.js |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// Flags: --harmony-scoping |
+// Flags: --harmony-scoping --harmony-classes |
function CheckError(source) { |
var exception = null; |
@@ -13,7 +13,7 @@ function CheckError(source) { |
} |
assertNotNull(exception); |
assertEquals( |
- "Lexical declarations are currently only allowed in strict mode", |
+ "Block-scoped declarations (let, const, function, class) not yet supported outside strict mode", |
exception.message); |
} |
@@ -28,6 +28,12 @@ CheckError("function f() { let x = 1; }"); |
CheckError("for (let x = 1; x < 1; x++) {}"); |
CheckError("for (let x of []) {}"); |
CheckError("for (let x in []) {}"); |
+CheckError("class C {}"); |
+CheckError("class C extends Array {}"); |
+CheckError("1, class {};"); |
arv (Not doing code reviews)
2014/11/19 16:51:04
I assume your intention was to test class expressi
rossberg
2014/11/19 17:23:43
No, the "1," in front causes it to be parsed as a
arv (Not doing code reviews)
2014/11/19 17:43:09
Ooops
The 1 was lost in the noise.
|
+CheckError("1, class extends Array {};"); |
+CheckError("1, class C {};"); |
+CheckError("1, class C exends Array {};"); |
CheckOk("let = 1;"); |
CheckOk("{ let = 1; }"); |