|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 var gDebuggee; |
|
5 var gClient; |
|
6 var gThreadClient; |
|
7 |
|
8 function run_test() |
|
9 { |
|
10 initTestDebuggerServer(); |
|
11 gDebuggee = addTestGlobal("test-grips"); |
|
12 |
|
13 gClient = new DebuggerClient(DebuggerServer.connectPipe()); |
|
14 gClient.connect(function() { |
|
15 attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) { |
|
16 gThreadClient = aThreadClient; |
|
17 test_banana_environment(); |
|
18 }); |
|
19 }); |
|
20 do_test_pending(); |
|
21 } |
|
22 |
|
23 function test_banana_environment() |
|
24 { |
|
25 |
|
26 gThreadClient.addOneTimeListener("paused", |
|
27 function(aEvent, aPacket) { |
|
28 do_check_matches({type:"paused", frame: |
|
29 {environment: |
|
30 {type: "function", function: {name: "banana3"}, |
|
31 parent: |
|
32 {type: "block", bindings: {variables: {banana3:undefined}}, |
|
33 parent: |
|
34 {type: "function", function: {name: "banana2"}, |
|
35 parent: |
|
36 {type:"block", bindings: {variables: {banana2:undefined}}, |
|
37 parent: |
|
38 {type:"block", bindings: {variables: {banana2:undefined}}, |
|
39 parent: |
|
40 {type:"function", function: {name: "banana"}}}}}}}}}, |
|
41 aPacket, |
|
42 { Object:Object, Array:Array }); |
|
43 gThreadClient.resume(function () { |
|
44 finishClient(gClient); |
|
45 }); |
|
46 }); |
|
47 |
|
48 gDebuggee.eval("\ |
|
49 function banana(x) { \n\ |
|
50 return function banana2(y) { \n\ |
|
51 return function banana3(z) { \n\ |
|
52 debugger; \n\ |
|
53 }; \n\ |
|
54 }; \n\ |
|
55 } \n\ |
|
56 banana('x')('y')('z'); \n\ |
|
57 "); |
|
58 } |