comparison: js/src/jit-test/tests/jaeger/recompile/undef.js
js/src/jit-test/tests/jaeger/recompile/undef.js
- changeset 0
- 6474c204b198
equal
deleted
inserted
replaced
|
1 |
|
2 /* Handle recompilation on undefined variables. */ |
|
3 |
|
4 function local() |
|
5 { |
|
6 var x; |
|
7 x++; |
|
8 assertEq(x, NaN); |
|
9 x = 0; |
|
10 } |
|
11 local(); |
|
12 |
|
13 function name(v) |
|
14 { |
|
15 var x; |
|
16 with (v) { |
|
17 x++; |
|
18 assertEq(x, NaN); |
|
19 } |
|
20 assertEq(x, NaN); |
|
21 x = 0; |
|
22 } |
|
23 name({}); |
|
24 |
|
25 function letname(v) |
|
26 { |
|
27 if (v) { |
|
28 let x; |
|
29 with (v) { |
|
30 x = "twelve"; |
|
31 } |
|
32 assertEq(x, "twelve"); |
|
33 } |
|
34 } |
|
35 letname({}); |
|
36 |
|
37 function upvar() |
|
38 { |
|
39 var x; |
|
40 function inner() { |
|
41 x++; |
|
42 assertEq(x, NaN); |
|
43 } |
|
44 inner(); |
|
45 } |
|
46 upvar(); |
|
47 |
|
48 var x; |
|
49 var y; |
|
50 |
|
51 function global() |
|
52 { |
|
53 x++; |
|
54 assertEq(x, NaN); |
|
55 var z = 2 + y; |
|
56 assertEq(z, NaN); |
|
57 } |
|
58 global(); |
|
59 |
|
60 x = 0; |
|
61 y = 0; |