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

Unified Diff: test/mjsunit/es6/completion.js

Issue 2537413003: [parsing] Fix bug in completion value of try-finally. (Closed)
Patch Set: Remove unused variable. Created 4 years 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
« no previous file with comments | « src/parsing/rewriter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/completion.js
diff --git a/test/mjsunit/es6/completion.js b/test/mjsunit/es6/completion.js
index 6bc7d47a025844d12a4fef62951dd4f1686bc88c..9d84a90406c902a11af1494222b00865bb0c0e8e 100644
--- a/test/mjsunit/es6/completion.js
+++ b/test/mjsunit/es6/completion.js
@@ -107,9 +107,22 @@ assertEquals(undefined, eval(
'var b = 1; ' +
'outer: while (1) { while (1) { if (b--) 42; else break outer; }; 666 }'));
-// The following is not what ES6 says, but see ES bug 4540.
assertUndef(eval('42; switch (0) { case 0: 1; if (true) break; }')); // ES5: 1
+assertUndef(eval('a: while(true) { do { 0 } while(false); switch(1) { case 0: 1; case 1: break a; }; 0 }'));
+assertUndef(eval('a: while(true) { do { 0 } while(false); try {} finally { break a }; 0 }'));
+assertUndef(eval('a: while(true) { b: while(true) { 0; break b; }; switch(1) { case 1: break a; }; 2 }'));
+assertUndef(eval('a: while(true) { b: while(true) { 0; break b; }; while (true) { break a; }; 2 }'));
+assertUndef(eval('while (true) { 20; a:{ break a; } with ({}) break; 30; }'));
+assertEquals(42, eval('a: while(true) { switch(0) { case 0: 42; case 1: break a; }; 33 }'));
+
+assertUndef(eval(
+ 'for (var i = 0; i < 2; ++i) { if (i) { try {} finally { break; } } 0; }'
+));
+assertUndef(eval(
+ 'for (var i = 0; i < 2; ++i) { if (i) { try {} finally { continue; } } 0; }'
+));
+
////////////////////////////////////////////////////////////////////////////////
@@ -146,10 +159,3 @@ assertUndef(eval(
assertUndef(eval("1; try{2; throwOnReturn();} catch(e){}"));
assertUndef(eval("1; twoFunc();"));
assertEquals(2, eval("1; with ( { a: 0 } ) { 2; }"));
-
-assertUndef(eval('a: while(true) { do { 0 } while(false); switch(1) { case 0: 1; case 1: break a; }; 0 }'));
-assertUndef(eval('a: while(true) { do { 0 } while(false); try {} finally { break a }; 0 }'));
-assertUndef(eval('a: while(true) { b: while(true) { 0; break b; }; switch(1) { case 1: break a; }; 2 }'));
-assertUndef(eval('a: while(true) { b: while(true) { 0; break b; }; while (true) { break a; }; 2 }'));
-assertUndef(eval('while (true) { 20; a:{ break a; } with ({}) break; 30; }'));
-assertEquals(42, eval('a: while(true) { switch(0) { case 0: 42; case 1: break a; }; 33 }'));
« no previous file with comments | « src/parsing/rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698