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

Unified Diff: test/mjsunit/regress/regress-990205.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/regress/regress-990205.js
diff --git a/test/mjsunit/regress/regress-990205.js b/test/mjsunit/regress/regress-990205.js
index 1ab5bf88b4252d475408e946808a557cfadbc90b..981e63f1b7e65c5c70875c696e739095ebd02d7c 100644
--- a/test/mjsunit/regress/regress-990205.js
+++ b/test/mjsunit/regress/regress-990205.js
@@ -25,11 +25,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// We not throw syntax errors early for invalid break and continue
Mads Ager (chromium) 2011/01/17 09:29:13 We not -> We
Lasse Reichstein 2011/01/17 09:34:08 Should have been "We now". Changed to just "We".
+// statements. The behavior has changed to make this a syntax error.
+// (Notice that the example isn't valid ECMAScript due to the
+// function declaration that is not at top level.)
+
function f() {
// Force eager compilation of x through the use of eval. The break
// in function x should not try to break out of the enclosing while.
return eval("while(0) function x() { break; }; 42");
};
-assertEquals(42, f());
+assertThrows("f()");
« test/mjsunit/delay-syntax-error.js ('K') | « test/mjsunit/regress/regress-1036894.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698