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

Side by Side Diff: test/mjsunit/es6/completion.js

Issue 2427253003: Simplify and fix the rewriter (Closed)
Patch Set: Fix and add tests Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/parsing/rewriter.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 function assertUndef(x) { 6 function assertUndef(x) {
7 assertEquals(undefined, x); 7 assertEquals(undefined, x);
8 } 8 }
9 9
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 assertUndef(eval("var x = 1;")); 139 assertUndef(eval("var x = 1;"));
140 assertEquals(1, eval("if (true) { 1; } else { 2; }")); 140 assertEquals(1, eval("if (true) { 1; } else { 2; }"));
141 assertEquals(2, eval("if (false) { 1; } else { 2; }")); 141 assertEquals(2, eval("if (false) { 1; } else { 2; }"));
142 assertUndef(eval("try{1; if (true) { 2; throw ''; } else { 2; }} catch(e){}")); 142 assertUndef(eval("try{1; if (true) { 2; throw ''; } else { 2; }} catch(e){}"));
143 assertEquals(2, eval("1; var i = 0; do { ++i; 2; } while(i!=1);")); 143 assertEquals(2, eval("1; var i = 0; do { ++i; 2; } while(i!=1);"));
144 assertUndef(eval( 144 assertUndef(eval(
145 "try{1; var i = 0; do { ++i; 2; throw ''; } while (i!=1);} catch(e){}")); 145 "try{1; var i = 0; do { ++i; 2; throw ''; } while (i!=1);} catch(e){}"));
146 assertUndef(eval("1; try{2; throwOnReturn();} catch(e){}")); 146 assertUndef(eval("1; try{2; throwOnReturn();} catch(e){}"));
147 assertUndef(eval("1; twoFunc();")); 147 assertUndef(eval("1; twoFunc();"));
148 assertEquals(2, eval("1; with ( { a: 0 } ) { 2; }")); 148 assertEquals(2, eval("1; with ( { a: 0 } ) { 2; }"));
149
150 assertUndef(eval('a: while(true) { do { 0 } while(false); switch(1) { case 0: 1; case 1: break a; }; 0 }'));
151 assertUndef(eval('a: while(true) { do { 0 } while(false); try {} finally { break a }; 0 }'));
152 assertUndef(eval('a: while(true) { b: while(true) { 0; break b; }; switch(1) { c ase 1: break a; }; 2 }'));
153 assertUndef(eval('a: while(true) { b: while(true) { 0; break b; }; while (true) { break a; }; 2 }'));
154 assertUndef(eval('while (true) { 20; a:{ break a; } with ({}) break; 30; }'));
155 assertEquals(42, eval('a: while(true) { switch(0) { case 0: 42; case 1: break a; }; 33 }'));
OLDNEW
« 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