michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Every function call enters a new execution context michael@0: * michael@0: * @path ch10/10.4/S10.4A1.1_T2.js michael@0: * @description Recursive function call michael@0: */ michael@0: michael@0: var y; michael@0: michael@0: function f(a){ michael@0: var x; michael@0: michael@0: if (a === 1) michael@0: return x; michael@0: else { michael@0: if(x === undefined) { michael@0: x = 0; michael@0: } else { michael@0: x = 1; michael@0: } michael@0: return f(1); michael@0: } michael@0: } michael@0: michael@0: y = f(0); michael@0: michael@0: if(!(y === undefined)){ michael@0: $ERROR("#1: Recursive function calls shares execution context"); michael@0: } michael@0: