Index: test/mjsunit/invalid-lhs.js |
diff --git a/test/mjsunit/invalid-lhs.js b/test/mjsunit/invalid-lhs.js |
index ef63add775ccebcb2290a69266574502630ecb00..92f5c6ff7e1cf1dbc1a02ce97f5300280080142e 100644 |
--- a/test/mjsunit/invalid-lhs.js |
+++ b/test/mjsunit/invalid-lhs.js |
@@ -29,37 +29,37 @@ |
// exceptions are delayed until runtime. |
// Normal assignments: |
-assertThrows("12 = 12"); |
-assertThrows("x++ = 12"); |
-assertThrows("eval('var x') = 12"); |
-assertDoesNotThrow("if (false) eval('var x') = 12"); |
+assertThrows("12 = 12", ReferenceError); |
+assertThrows("x++ = 12", ReferenceError); |
+assertThrows("eval('var x') = 12", ReferenceError); |
+assertThrows("if (false) eval('var x') = 12", ReferenceError); |
// Pre- and post-fix operations: |
-assertThrows("12++"); |
-assertThrows("12--"); |
-assertThrows("--12"); |
-assertThrows("++12"); |
-assertThrows("++(eval('12'))"); |
-assertThrows("(eval('12'))++"); |
-assertDoesNotThrow("if (false) ++(eval('12'))"); |
-assertDoesNotThrow("if (false) (eval('12'))++"); |
+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); |
// For in: |
-assertThrows("for (12 in [1]) print(12);"); |
-assertThrows("for (eval('var x') in [1]) print(12);"); |
-assertDoesNotThrow("if (false) for (eval('var x') in [1]) print(12);"); |
+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); |
// For: |
-assertThrows("for (12 = 1;;) print(12);"); |
-assertThrows("for (eval('var x') = 1;;) print(12);"); |
-assertDoesNotThrow("if (false) for (eval('var x') = 1;;) print(12);"); |
+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); |
// Assignments to 'this'. |
-assertThrows("this = 42"); |
-assertDoesNotThrow("function f() { this = 12; }"); |
-assertThrows("for (this in {x:3, y:4, z:5}) ;"); |
-assertThrows("for (this = 0;;) ;"); |
-assertThrows("this++"); |
-assertThrows("++this"); |
-assertThrows("this--"); |
-assertThrows("--this"); |
+assertThrows("this = 42", ReferenceError); |
+assertThrows("function f() { this = 12; }", ReferenceError); |
+assertThrows("for (this in {x:3, y:4, z:5}) ;", ReferenceError); |
+assertThrows("for (this = 0;;) ;", ReferenceError); |
+assertThrows("this++", ReferenceError); |
+assertThrows("++this", ReferenceError); |
+assertThrows("this--", ReferenceError); |
+assertThrows("--this", ReferenceError); |