Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/conditional/tco-cond.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 description: Expression is a candidate for tail-call optimization.
5 esid: sec-static-semantics-hascallintailposition
6 flags: [onlyStrict]
7 features: [tail-call-optimization]
8 includes: [tcoHelper.js]
9 ---*/
10
11 var callCount = 0;
12 (function f(n) {
13 if (n === 0) {
14 callCount += 1
15 return;
16 }
17 return true ? f(n - 1) : 0;
18 }($MAX_ITERATIONS));
19 assert.sameValue(callCount, 1);