2016-02-01 18:10:33 +01:00
|
|
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
|
|
description: Statement within statement is a candidate for tail-call optimization.
|
2016-02-22 15:47:03 +01:00
|
|
|
esid: static-semantics-hasproductionintailposition
|
2016-02-01 18:10:33 +01:00
|
|
|
flags: [onlyStrict]
|
|
|
|
features: [tail-call-optimization]
|
2017-06-23 17:06:32 +02:00
|
|
|
includes: [tcoHelper.js]
|
2016-02-01 18:10:33 +01:00
|
|
|
---*/
|
|
|
|
|
|
|
|
var callCount = 0;
|
|
|
|
(function f(n) {
|
|
|
|
if (n === 0) {
|
|
|
|
callCount += 1
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
{ return f(n - 1); }
|
|
|
|
}($MAX_ITERATIONS));
|
|
|
|
assert.sameValue(callCount, 1);
|