|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 //----------------------------------------------------------------------------- |
|
7 var BUGNUMBER = 495773; |
|
8 var summary = 'Read upvar from trace-entry frame from JSStackFrame instead of tracing native stack'; |
|
9 var actual = '' |
|
10 var expect = '010101'; |
|
11 //----------------------------------------------------------------------------- |
|
12 function f() { |
|
13 var q = []; |
|
14 for (var a = 0; a < 3; ++a) { |
|
15 (function () { |
|
16 for (var b = 0; b < 2; ++b) { |
|
17 (function () { |
|
18 for (var c = 0; c < 1; ++c) { |
|
19 q.push(b); |
|
20 } |
|
21 })(); |
|
22 } |
|
23 })(); |
|
24 } |
|
25 return q.join(""); |
|
26 } |
|
27 |
|
28 test(); |
|
29 //----------------------------------------------------------------------------- |
|
30 |
|
31 function test() |
|
32 { |
|
33 enterFunc ('test'); |
|
34 printBugNumber(BUGNUMBER); |
|
35 printStatus (summary); |
|
36 |
|
37 jit(true); |
|
38 actual = f(); |
|
39 jit(false); |
|
40 |
|
41 reportCompare(expect, actual, summary); |
|
42 |
|
43 exitFunc ('test'); |
|
44 } |