Debian Codegraph @

js/src/tests/test262/language/expressions/logical-and/tco-right-strict.js

raw
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: Expression 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 return true && f(n - 1);
20 }($MAX_ITERATIONS));
21 assert.sameValue(callCount, 1);
22
23 reportCompare(0, 0);