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

Unified Diff: test/mjsunit/delay-syntax-error.js

Issue 6355006: Make invalid break/continue statements an early syntax error. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-ia32
Patch Set: Created 9 years, 11 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
Index: test/mjsunit/delay-syntax-error.js
diff --git a/test/mjsunit/delay-syntax-error.js b/test/mjsunit/delay-syntax-error.js
index 4fcb1435c574c8d609a102b0d9ceaa955e6dae17..25ccd1ba61c94136c574a24c186f652256735fa5 100644
--- a/test/mjsunit/delay-syntax-error.js
+++ b/test/mjsunit/delay-syntax-error.js
@@ -27,15 +27,18 @@
// To be compatible with KJS syntax errors for illegal return, break
// and continue should be delayed to runtime.
+// CHANGED in Jan. 2011. JSC switched to reporting these syntax errors
Mads Ager (chromium) 2011/01/17 09:29:13 Let's just update the description with the current
Lasse Reichstein 2011/01/17 09:34:08 Done.
+// early and we have followed.
-// Do not throw syntax errors for illegal return, break and continue
-// at compile time.
+// Do not throw syntax errors for illegal return at compile time.
assertDoesNotThrow("if (false) return;");
-assertDoesNotThrow("if (false) break;");
-assertDoesNotThrow("if (false) continue;");
+
+// Do throw syntax errors for illegal break and continue at compile time.
Mads Ager (chromium) 2011/01/17 09:29:13 Do throw -> Throw
Lasse Reichstein 2011/01/17 09:34:08 Done.
+assertThrows("if (false) break;");
+assertThrows("if (false) continue;");
// Throw syntax errors for illegal return, break and continue at
-// compile time.
+// runtime.
assertThrows("return;");
assertThrows("break;");
assertThrows("continue;");

Powered by Google App Engine
This is Rietveld 408576698