michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: var gDebuggee; michael@0: var gClient; michael@0: var gThreadClient; michael@0: michael@0: function run_test() michael@0: { michael@0: initTestDebuggerServer(); michael@0: gDebuggee = addTestGlobal("test-grips"); michael@0: gDebuggee.eval(function stopMe(arg1) { michael@0: debugger; michael@0: }.toString()); michael@0: michael@0: gClient = new DebuggerClient(DebuggerServer.connectPipe()); michael@0: gClient.connect(function() { michael@0: attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) { michael@0: gThreadClient = aThreadClient; michael@0: test_object_grip(); michael@0: }); michael@0: }); michael@0: do_test_pending(); michael@0: } michael@0: michael@0: function test_object_grip() michael@0: { michael@0: gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) { michael@0: let args = aPacket.frame.arguments; michael@0: michael@0: do_check_eq(args[0].class, "Object"); michael@0: michael@0: let objClient = gThreadClient.pauseGrip(args[0]); michael@0: objClient.getPrototypeAndProperties(function(aResponse) { michael@0: do_check_eq(aResponse.ownProperties.a.configurable, true); michael@0: do_check_eq(aResponse.ownProperties.a.enumerable, true); michael@0: do_check_eq(aResponse.ownProperties.a.writable, true); michael@0: do_check_eq(aResponse.ownProperties.a.value.type, "Infinity"); michael@0: michael@0: do_check_eq(aResponse.ownProperties.b.configurable, true); michael@0: do_check_eq(aResponse.ownProperties.b.enumerable, true); michael@0: do_check_eq(aResponse.ownProperties.b.writable, true); michael@0: do_check_eq(aResponse.ownProperties.b.value.type, "-Infinity"); michael@0: michael@0: do_check_eq(aResponse.ownProperties.c.configurable, true); michael@0: do_check_eq(aResponse.ownProperties.c.enumerable, true); michael@0: do_check_eq(aResponse.ownProperties.c.writable, true); michael@0: do_check_eq(aResponse.ownProperties.c.value.type, "NaN"); michael@0: michael@0: do_check_eq(aResponse.ownProperties.d.configurable, true); michael@0: do_check_eq(aResponse.ownProperties.d.enumerable, true); michael@0: do_check_eq(aResponse.ownProperties.d.writable, true); michael@0: do_check_eq(aResponse.ownProperties.d.value.type, "-0"); michael@0: michael@0: gThreadClient.resume(function() { michael@0: finishClient(gClient); michael@0: }); michael@0: }); michael@0: }); michael@0: michael@0: gDebuggee.eval("stopMe({ a: Infinity, b: -Infinity, c: NaN, d: -0 })"); michael@0: } michael@0: