mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09: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:
parent
3ce9cf4deb
commit
e861cd3b3a
2 changed files with 29 additions and 19 deletions
|
|
@ -2159,6 +2159,12 @@ function createValueGrip(value, pool, makeObjectGrip) {
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
|
case "bigint":
|
||||||
|
return {
|
||||||
|
type: "BigInt",
|
||||||
|
text: value.toString(),
|
||||||
|
};
|
||||||
|
|
||||||
case "undefined":
|
case "undefined":
|
||||||
return { type: "undefined" };
|
return { type: "undefined" };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,25 +41,15 @@ function test_object_grip()
|
||||||
|
|
||||||
let objClient = gThreadClient.pauseGrip(args[0]);
|
let objClient = gThreadClient.pauseGrip(args[0]);
|
||||||
objClient.getPrototypeAndProperties(function (aResponse) {
|
objClient.getPrototypeAndProperties(function (aResponse) {
|
||||||
do_check_eq(aResponse.ownProperties.a.configurable, true);
|
const {a, b, c, d, e, f, g} = aResponse.ownProperties;
|
||||||
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");
|
|
||||||
|
|
||||||
do_check_eq(aResponse.ownProperties.b.configurable, true);
|
testPropertyType(a, "Infinity");
|
||||||
do_check_eq(aResponse.ownProperties.b.enumerable, true);
|
testPropertyType(b, "-Infinity");
|
||||||
do_check_eq(aResponse.ownProperties.b.writable, true);
|
testPropertyType(c, "NaN");
|
||||||
do_check_eq(aResponse.ownProperties.b.value.type, "-Infinity");
|
testPropertyType(d, "-0");
|
||||||
|
testPropertyType(e, "BigInt");
|
||||||
do_check_eq(aResponse.ownProperties.c.configurable, true);
|
testPropertyType(f, "BigInt");
|
||||||
do_check_eq(aResponse.ownProperties.c.enumerable, true);
|
testPropertyType(g, "BigInt");
|
||||||
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");
|
|
||||||
|
|
||||||
gThreadClient.resume(function () {
|
gThreadClient.resume(function () {
|
||||||
gClient.close().then(gCallback);
|
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);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue