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

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

Issue 220473014: Make stray 'return' an early error (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 64cc1429bbcb2fc7c43d00a88c6d17f0e9142a95..20b2affacc0d2b11fb440ad97f2c398c3d8c7eba 100644
--- a/test/mjsunit/delay-syntax-error.js
+++ b/test/mjsunit/delay-syntax-error.js
@@ -25,18 +25,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// To be compatible with JSC syntax errors for illegal returns should be delayed
-// to runtime.
-// Invalid continue and break statements are caught at compile time.
-
-// Do not throw syntax errors for illegal return at compile time.
-assertDoesNotThrow("if (false) return;");
-
-// Throw syntax errors for illegal break and continue at compile time.
+// Throw syntax errors for illegal return, break and continue at compile time.
+assertThrows("if (false) return;");
assertThrows("if (false) break;");
assertThrows("if (false) continue;");
-// Throw syntax errors for illegal return, break and continue at runtime.
assertThrows("return;");
assertThrows("break;");
assertThrows("continue;");

Powered by Google App Engine
This is Rietveld 408576698