Index: test/mjsunit/invalid-lhs.js |
diff --git a/test/mjsunit/invalid-lhs.js b/test/mjsunit/invalid-lhs.js |
index 92f5c6ff7e1cf1dbc1a02ce97f5300280080142e..52ee89582a4d059bbf3b92cb05a627ed36a39aa0 100644 |
--- a/test/mjsunit/invalid-lhs.js |
+++ b/test/mjsunit/invalid-lhs.js |
@@ -32,27 +32,34 @@ |
assertThrows("12 = 12", ReferenceError); |
assertThrows("x++ = 12", ReferenceError); |
assertThrows("eval('var x') = 12", ReferenceError); |
-assertThrows("if (false) eval('var x') = 12", ReferenceError); |
+assertThrows("if (false) 12 = 12", ReferenceError); |
+assertDoesNotThrow("if (false) eval('var x') = 12", ReferenceError); |
// Pre- and post-fix operations: |
assertThrows("12++", ReferenceError); |
assertThrows("12--", ReferenceError); |
-assertThrows("--12", ReferenceError); |
assertThrows("++12", ReferenceError); |
+assertThrows("--12", ReferenceError); |
assertThrows("++(eval('12'))", ReferenceError); |
assertThrows("(eval('12'))++", ReferenceError); |
-assertThrows("if (false) ++(eval('12'))", ReferenceError); |
-assertThrows("if (false) (eval('12'))++", ReferenceError); |
+assertThrows("if (false) 12++", ReferenceError); |
+assertThrows("if (false) 12--", ReferenceError); |
+assertThrows("if (false) ++12", ReferenceError); |
+assertThrows("if (false) --12", ReferenceError); |
+assertDoesNotThrow("if (false) ++(eval('12'))", ReferenceError); |
+assertDoesNotThrow("if (false) (eval('12'))++", ReferenceError); |
// For in: |
assertThrows("for (12 in [1]) print(12);", ReferenceError); |
assertThrows("for (eval('var x') in [1]) print(12);", ReferenceError); |
-assertThrows("if (false) for (eval('0') in [1]) print(12);", ReferenceError); |
+assertThrows("if (false) for (12 in [1]) print(12);", ReferenceError); |
+assertDoesNotThrow("if (false) for (eval('0') in [1]) print(12);", ReferenceError); |
// For: |
assertThrows("for (12 = 1;;) print(12);", ReferenceError); |
assertThrows("for (eval('var x') = 1;;) print(12);", ReferenceError); |
-assertThrows("if (false) for (eval('var x') = 1;;) print(12);", ReferenceError); |
+assertThrows("if (false) for (12 = 1;;) print(12);", ReferenceError); |
+assertDoesNotThrow("if (false) for (eval('var x') = 1;;) print(12);", ReferenceError); |
// Assignments to 'this'. |
assertThrows("this = 42", ReferenceError); |
@@ -63,3 +70,5 @@ assertThrows("this++", ReferenceError); |
assertThrows("++this", ReferenceError); |
assertThrows("this--", ReferenceError); |
assertThrows("--this", ReferenceError); |
+assertThrows("if (false) this = 42", ReferenceError); |
+assertThrows("if (false) this++", ReferenceError); |