|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 // Test that we get the magic properties on Error objects. |
|
5 |
|
6 var gDebuggee; |
|
7 var gClient; |
|
8 var gThreadClient; |
|
9 |
|
10 function run_test() |
|
11 { |
|
12 initTestDebuggerServer(); |
|
13 gDebuggee = addTestGlobal("test-grips"); |
|
14 gDebuggee.eval(function stopMe(arg1) { |
|
15 debugger; |
|
16 }.toString()); |
|
17 |
|
18 gClient = new DebuggerClient(DebuggerServer.connectPipe()); |
|
19 gClient.connect(function() { |
|
20 attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) { |
|
21 gThreadClient = aThreadClient; |
|
22 test_object_grip(); |
|
23 }); |
|
24 }); |
|
25 do_test_pending(); |
|
26 } |
|
27 |
|
28 function test_object_grip() |
|
29 { |
|
30 gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) { |
|
31 let args = aPacket.frame.arguments; |
|
32 |
|
33 let objClient = gThreadClient.pauseGrip(args[0]); |
|
34 objClient.getOwnPropertyNames(function(aResponse) { |
|
35 var opn = aResponse.ownPropertyNames; |
|
36 do_check_eq(opn.length, 5); |
|
37 opn.sort(); |
|
38 do_check_eq(opn[0], "columnNumber"); |
|
39 do_check_eq(opn[1], "fileName"); |
|
40 do_check_eq(opn[2], "lineNumber"); |
|
41 do_check_eq(opn[3], "message"); |
|
42 do_check_eq(opn[4], "stack"); |
|
43 |
|
44 gThreadClient.resume(function() { |
|
45 finishClient(gClient); |
|
46 }); |
|
47 }); |
|
48 |
|
49 }); |
|
50 |
|
51 gDebuggee.eval("stopMe(new TypeError('error message text'))"); |
|
52 } |
|
53 |