2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: Every function call enters a new execution context
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 10.4A1.1_T2
|
2014-07-22 01:09:02 +02:00
|
|
|
description: Recursive function call
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
var y;
|
|
|
|
|
|
|
|
function f(a){
|
|
|
|
var x;
|
2021-07-28 22:47:49 +02:00
|
|
|
|
|
|
|
if (a === 1)
|
2011-09-07 08:35:18 +02:00
|
|
|
return x;
|
|
|
|
else {
|
|
|
|
if(x === undefined) {
|
|
|
|
x = 0;
|
|
|
|
} else {
|
|
|
|
x = 1;
|
|
|
|
}
|
|
|
|
return f(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
y = f(0);
|
|
|
|
|
|
|
|
if(!(y === undefined)){
|
2021-07-28 22:47:49 +02:00
|
|
|
throw new Test262Error("#1: Recursive function calls shares execution context");
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|