|
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 * Every function call enters a new execution context |
|
6 * |
|
7 * @path ch10/10.4/S10.4_A1.1_T1.js |
|
8 * @description Sequence of function calls |
|
9 */ |
|
10 |
|
11 var y; |
|
12 |
|
13 function f(){ |
|
14 var x; |
|
15 |
|
16 if(x === undefined) { |
|
17 x = 0; |
|
18 } else { |
|
19 x = 1; |
|
20 } |
|
21 |
|
22 return x; |
|
23 } |
|
24 |
|
25 y = f(); |
|
26 y = f(); |
|
27 |
|
28 if(!(y === 0)){ |
|
29 $ERROR("#1: Sequenced function calls shares execution context"); |
|
30 } |
|
31 |