mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 13:58:49 +00:00
Issue #2026 - Part 3a - Add support for BigInt in devtools. (Server side) https://bugzilla.mozilla.org/show_bug.cgi?id=1527867
This commit is contained in:
@@ -2159,6 +2159,12 @@ function createValueGrip(value, pool, makeObjectGrip) {
|
||||
}
|
||||
return value;
|
||||
|
||||
case "bigint":
|
||||
return {
|
||||
type: "BigInt",
|
||||
text: value.toString(),
|
||||
};
|
||||
|
||||
case "undefined":
|
||||
return { type: "undefined" };
|
||||
|
||||
|
||||
@@ -41,25 +41,15 @@ function test_object_grip()
|
||||
|
||||
let objClient = gThreadClient.pauseGrip(args[0]);
|
||||
objClient.getPrototypeAndProperties(function (aResponse) {
|
||||
do_check_eq(aResponse.ownProperties.a.configurable, true);
|
||||
do_check_eq(aResponse.ownProperties.a.enumerable, true);
|
||||
do_check_eq(aResponse.ownProperties.a.writable, true);
|
||||
do_check_eq(aResponse.ownProperties.a.value.type, "Infinity");
|
||||
const {a, b, c, d, e, f, g} = aResponse.ownProperties;
|
||||
|
||||
do_check_eq(aResponse.ownProperties.b.configurable, true);
|
||||
do_check_eq(aResponse.ownProperties.b.enumerable, true);
|
||||
do_check_eq(aResponse.ownProperties.b.writable, true);
|
||||
do_check_eq(aResponse.ownProperties.b.value.type, "-Infinity");
|
||||
|
||||
do_check_eq(aResponse.ownProperties.c.configurable, true);
|
||||
do_check_eq(aResponse.ownProperties.c.enumerable, true);
|
||||
do_check_eq(aResponse.ownProperties.c.writable, true);
|
||||
do_check_eq(aResponse.ownProperties.c.value.type, "NaN");
|
||||
|
||||
do_check_eq(aResponse.ownProperties.d.configurable, true);
|
||||
do_check_eq(aResponse.ownProperties.d.enumerable, true);
|
||||
do_check_eq(aResponse.ownProperties.d.writable, true);
|
||||
do_check_eq(aResponse.ownProperties.d.value.type, "-0");
|
||||
testPropertyType(a, "Infinity");
|
||||
testPropertyType(b, "-Infinity");
|
||||
testPropertyType(c, "NaN");
|
||||
testPropertyType(d, "-0");
|
||||
testPropertyType(e, "BigInt");
|
||||
testPropertyType(f, "BigInt");
|
||||
testPropertyType(g, "BigInt");
|
||||
|
||||
gThreadClient.resume(function () {
|
||||
gClient.close().then(gCallback);
|
||||
@@ -67,6 +57,20 @@ function test_object_grip()
|
||||
});
|
||||
});
|
||||
|
||||
gDebuggee.eval("stopMe({ a: Infinity, b: -Infinity, c: NaN, d: -0 })");
|
||||
gDebuggee.eval(`stopMe({
|
||||
a: Infinity,
|
||||
b: -Infinity,
|
||||
c: NaN,
|
||||
d: -0,
|
||||
e: 1n,
|
||||
f: -2n,
|
||||
g: 0n,
|
||||
})`);
|
||||
}
|
||||
|
||||
function testPropertyType(prop, expectedType) {
|
||||
do_check_eq(prop.configurable, true);
|
||||
do_check_eq(prop.enumerable, true);
|
||||
do_check_eq(prop.writable, true);
|
||||
do_check_eq(prop.value.type, expectedType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user