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

Side by Side Diff: test/mjsunit/es6/tail-call.js

Issue 1921083002: [es6] Fix tail call elimination in single-expression arrow functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/parsing/preparser.h ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 // Flags: --allow-natives-syntax --harmony-tailcalls 5 // Flags: --allow-natives-syntax --harmony-tailcalls
6 "use strict"; 6 "use strict";
7 7
8 Error.prepareStackTrace = (error,stack) => { 8 Error.prepareStackTrace = (error,stack) => {
9 error.strace = stack; 9 error.strace = stack;
10 return error.message + "\n at " + stack.join("\n at "); 10 return error.message + "\n at " + stack.join("\n at ");
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 assertEquals(153, tcf1()); 385 assertEquals(153, tcf1());
386 assertEquals(153, tcf2()); 386 assertEquals(153, tcf2());
387 assertEquals(153, tcf3()); 387 assertEquals(153, tcf3());
388 assertEquals(153, tcf4()); 388 assertEquals(153, tcf4());
389 } 389 }
390 test(); 390 test();
391 test(); 391 test();
392 %OptimizeFunctionOnNextCall(test); 392 %OptimizeFunctionOnNextCall(test);
393 test(); 393 test();
394 })(); 394 })();
395
396
397 // Test tail calls from arrow functions.
398 (function () {
399 function g1(a) {
400 return (() => { return f_153([f_153, test]); })();
401 }
402
403 function g2(a) {
404 return (() => f_153([f_153, test]))();
405 }
406
407 function test() {
408 assertEquals(153, g1());
409 assertEquals(153, g2());
410 }
411 test();
412 test();
413 %OptimizeFunctionOnNextCall(test);
414 test();
415 })();
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698