tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

tco-lhs-body-strict.js (663B)


      1 // |reftest| skip -- tail-call-optimization is not supported
      2 'use strict';
      3 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      4 // This code is governed by the BSD license found in the LICENSE file.
      5 /*---
      6 description: Statement within statement is a candidate for tail-call optimization.
      7 esid: sec-static-semantics-hascallintailposition
      8 flags: [onlyStrict]
      9 features: [tail-call-optimization]
     10 includes: [tcoHelper.js]
     11 ---*/
     12 
     13 var callCount = 0;
     14 (function f(n) {
     15  if (n === 0) {
     16    callCount += 1
     17    return;
     18  }
     19  var x;
     20  for (x = 0; x < 1; ++x) {
     21    return f(n - 1);
     22  }
     23 }($MAX_ITERATIONS));
     24 assert.sameValue(callCount, 1);
     25 
     26 reportCompare(0, 0);