diff options
author | Brian Smith <brian@dbsoft.org> | 2023-07-25 02:27:03 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2023-07-25 02:27:03 -0500 |
commit | 56a82b8ed44c20354dc82453aa76f9f89f68d2e0 (patch) | |
tree | 6cd072c6aa8e35e98f005437174ffe2e15368352 | |
parent | 7a5b68c98ebde399166bef6fecb932760dc1006d (diff) | |
download | uxp-56a82b8ed44c20354dc82453aa76f9f89f68d2e0.tar.gz |
Issue #2026 - Part 3a - Add support for BigInt in devtools. (Server side)
https://bugzilla.mozilla.org/show_bug.cgi?id=1527867
-rw-r--r-- | devtools/server/actors/object.js | 6 | ||||
-rw-r--r-- | devtools/server/tests/unit/test_objectgrips-08.js | 42 |
2 files changed, 29 insertions, 19 deletions
diff --git a/devtools/server/actors/object.js b/devtools/server/actors/object.js index ab04b97048..7688e35c88 100644 --- a/devtools/server/actors/object.js +++ b/devtools/server/actors/object.js @@ -2159,6 +2159,12 @@ function createValueGrip(value, pool, makeObjectGrip) { } return value; + case "bigint": + return { + type: "BigInt", + text: value.toString(), + }; + case "undefined": return { type: "undefined" }; diff --git a/devtools/server/tests/unit/test_objectgrips-08.js b/devtools/server/tests/unit/test_objectgrips-08.js index ecaa7146db..2bd48a34c6 100644 --- a/devtools/server/tests/unit/test_objectgrips-08.js +++ b/devtools/server/tests/unit/test_objectgrips-08.js @@ -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); +} |