diff options
author | Martok <martok@martoks-place.de> | 2023-07-28 23:35:59 +0200 |
---|---|---|
committer | Martok <martok@martoks-place.de> | 2023-07-28 23:35:59 +0200 |
commit | fa32034f305b18480aefded068962b2862e7ccd3 (patch) | |
tree | e2f38e55ab6cdf6239320e950e8d86deff4525d9 /devtools | |
parent | 7a5b68c98ebde399166bef6fecb932760dc1006d (diff) | |
download | uxp-fa32034f305b18480aefded068962b2862e7ccd3.tar.gz |
Issue #2026 - Part 3b - Add BigInt Devtools support. (legacy frontend)
Diffstat (limited to 'devtools')
-rw-r--r-- | devtools/client/shared/widgets/VariablesView.jsm | 19 | ||||
-rw-r--r-- | devtools/client/webconsole/console-output.js | 10 | ||||
-rw-r--r-- | devtools/server/actors/object.js | 6 |
3 files changed, 26 insertions, 9 deletions
diff --git a/devtools/client/shared/widgets/VariablesView.jsm b/devtools/client/shared/widgets/VariablesView.jsm index f7be87f44f..2ba8d74916 100644 --- a/devtools/client/shared/widgets/VariablesView.jsm +++ b/devtools/client/shared/widgets/VariablesView.jsm @@ -3236,14 +3236,6 @@ VariablesView.prototype.isOverridden = function (aItem) { * The variable's descriptor. */ VariablesView.isPrimitive = function (aDescriptor) { - // For accessor property descriptors, the getter and setter need to be - // contained in 'get' and 'set' properties. - let getter = aDescriptor.get; - let setter = aDescriptor.set; - if (getter || setter) { - return false; - } - // As described in the remote debugger protocol, the value grip // must be contained in a 'value' property. let grip = aDescriptor.value; @@ -3261,7 +3253,8 @@ VariablesView.isPrimitive = function (aDescriptor) { type == "NaN" || type == "-0" || type == "symbol" || - type == "longString") { + type == "longString" || + type == "BigInt") { return true; } @@ -3354,6 +3347,10 @@ VariablesView.getGrip = function (aValue) { return { type: "-0" }; } return aValue; + case "bigint": + return { type: "BigInt", + text: aValue.toString(), + }; case "undefined": // document.all is also "undefined" if (aValue === undefined) { @@ -3496,6 +3493,10 @@ VariablesView.stringifiers.byType = { return keyString + " \u2192 " + valueString; }, + BigInt: function (aGrip, aOptions) { + return aGrip.text + "n"; + }, + }; // VariablesView.stringifiers.byType VariablesView.stringifiers.byObjectClass = { diff --git a/devtools/client/webconsole/console-output.js b/devtools/client/webconsole/console-output.js index 649ec65ae6..8fbaec94fe 100644 --- a/devtools/client/webconsole/console-output.js +++ b/devtools/client/webconsole/console-output.js @@ -1293,6 +1293,7 @@ Messages.Extended.prototype = extend(Messages.Simple.prototype, { { let map = { "number": "cm-number", + "bigint": "cm-number", "longstring": "console-string", "string": "console-string", "regexp": "cm-string-2", @@ -3365,6 +3366,15 @@ Widgets.ObjectRenderers.add({ }); /** + * The widget used for displaying BigInt previews. + */ +Widgets.ObjectRenderers.add({ + byClass: "BigInt", + + render: WrappedPrimitiveRenderer, +}); + +/** * The widget used for displaying String previews. */ Widgets.ObjectRenderers.add({ 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" }; |