S10.4A1.1_T2.js (567B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: Every function call enters a new execution context 6 es5id: 10.4A1.1_T2 7 description: Recursive function call 8 ---*/ 9 10 var y; 11 12 function f(a){ 13 var x; 14 15 if (a === 1) 16 return x; 17 else { 18 if(x === undefined) { 19 x = 0; 20 } else { 21 x = 1; 22 } 23 return f(1); 24 } 25 } 26 27 y = f(0); 28 29 if(!(y === undefined)){ 30 throw new Test262Error("#1: Recursive function calls shares execution context"); 31 } 32 33 reportCompare(0, 0);