Bug 1783397 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

```
js> dumpValue(true);

{
  "type": "boolean",
  "value": true
}

js> dumpValue(null);

{
  "type": "null"
}

js> dumpValue(undefined);

{
  "type": "undefined"
}

js> dumpValue(10);

{
  "type": "int32",
  "value": 10
}

js> dumpValue(1.1);

{
  "type": "double",
  "value": "1.1",
  "private": "0x3ff199999999999a"
}

js> dumpValue(10n);

{
  "type": "bigint",
  "digitLength": 1,
  "value": "10n"
}

js> dumpValue("foo");

{
  "type": "string",
  "address": "(JSAtom*)0x536bd42d480",
  "flags": [ "ATOM_BIT", "LINEAR_BIT", "INLINE_BIT", "PERMANENT", "LATIN1_CHARS_BIT", "PINNED_ATOM_BIT" ],
  "isTenured": true,
  "length": 3,
  "chars": "(JS::Latin1Char*)0x536bd42d488",
  "value": "foo"
}

js> dumpValue(Symbol.iterator);

{
  "type": "symbol",
  "address": "0x536bd43a040",
  "code": "iterator",
  "description": "Symbol.iterator"
}

js> dumpValue(Symbol("foo"));

{
  "type": "symbol",
  "address": "0x536bd471030",
  "code": "UniqueSymbol",
  "description": "foo"
}

js> dumpValue(Symbol.for("foo"));

{
  "type": "symbol",
  "address": "0x536bd471040",
  "code": "InSymbolRegistry",
  "description": "foo"
}

js> dumpValue(/foo/ig);

{
  "type": "object",
  "address": "0x1aa29d500798",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106143b78 [RegExp]>",
  "shape": "<0x536bd466fa0, objectFlags=[]>",
  "proto": "<RegExp.prototype @ 0x536bd441100>",
  "regexpFlags": [ "IgnoreCase", "Global" ],
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "0",
    "1": "'foo' @ (JSAtom*)0x536bd42d480",
    "2": "3",
    "3": "<private GCThing @ 0x536bd472098>"
  },
  "properties": {
    "lastIndex": "0 (map=0x536bd444f30, index=0, writable, slot=0)"
  }
}

js> dumpValue({});

{
  "type": "object",
  "address": "0x1aa29d5007d8",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106137848 [Object]>",
  "shape": "<0x536bd466fc0, objectFlags=[]>",
  "proto": "<Object @ 0x536bd441040>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "properties": {
  }
}

js> dumpValue([]);

{
  "type": "object",
  "address": "0x1aa29d500818",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106135520 [Array]>",
  "shape": "<0x536bd466580, objectFlags=[]>",
  "proto": "<Array @ 0x536bd43e088>",
  "elementsHeader": "<0x1aa29d500830, flags=[FIXED], init=0, capacity=6, length=0>",
  "properties": {
    "length": "(map=0x536bd45f780, index=0, writable, <custom-data-prop>)"
  }
}

js> dumpValue(Array);

{
  "type": "object",
  "address": "0x536bd463820",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x1061416d8 [Function]>",
  "shape": "<0x536bd466320, objectFlags=[]>",
  "proto": "<Function (anonymous) @ 0x536bd443040>",
  "displayAtom": "Array",
  "nargs": 1,
  "functionFlags": [ "NORMAL_KIND", "CONSTRUCTOR" ],
  "native": "0x1028434a8",
  "jitInfo": "0x104c4d030",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "65664",
    "1": "2.1428545825e-314 / <private @ 0x1028434a8>",
    "2": "2.161524608e-314 / <private @ 0x104c4d030>",
    "3": "'Array' @ (JSAtom*)0x536bd42c560"
  },
  "properties": {
    "isArray": "<Function isArray @ 0x536bd463b30> (map=0x536bd444bf0, index=0, configurable, writable, slot=4)"
    "from": "<Function from @ 0x536bd445e50> (map=0x536bd444bf0, index=1, configurable, writable, slot=5)"
    "of": "<Function of @ 0x536bd463b68> (map=0x536bd444bf0, index=2, configurable, writable, slot=6)"
    "Symbol.species": "getter=0x536bd445e98, setter=0x0 (map=0x536bd444bf0, index=3, configurable, slot=7)"
    "prototype": "<Array @ 0x536bd43e088> (map=0x536bd444bf0, index=4, slot=8)"
  }
}

js> dumpValue(function f() {});

{
  "type": "object",
  "address": "0x1aa29d500878",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x1061416d8 [Function]>",
  "shape": "<0x536bd43d160, objectFlags=[]>",
  "proto": "<Function (anonymous) @ 0x536bd443040>",
  "displayAtom": "f",
  "baseScript": "/Users/arai/Documents/xpi/mozpatch/dump-value/test.js:60:20 @ 0x536bd46a060",
  "nargs": 0,
  "functionFlags": [ "NORMAL_KIND", "BASESCRIPT", "CONSTRUCTOR", "LAMBDA" ],
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "672",
    "1": "<LexicalEnvironment @ 0x536bd43f038>",
    "2": "2.832311301673e-311 / <private @ 0x536bd46a060>",
    "3": "'f' @ (JSAtom*)0x536bd404d00"
  },
  "properties": {
  }
}

js> dumpValue(new Int8Array([1, 2, 3]));

{
  "type": "object",
  "address": "0x1aa29d5008b8",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106147e28 [Int8Array]>",
  "shape": "<0x536bd46fda0, objectFlags=[]>",
  "proto": "<Int8Array.prototype @ 0x536bd441148>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "null",
    "1": "1.5e-323 / <private @ 0x3>",
    "2": "0 / <private @ 0x0>",
    "3": "1.44690712744897e-310 / <private @ 0x1aa29d5008f0>"
  },
  "properties": {
  }
}

js> dumpValue(new Promise(() => {}));

{
  "type": "object",
  "address": "0x1aa29d500958",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106141c70 [Promise]>",
  "shape": "<0x536bd46ffe0, objectFlags=[]>",
  "proto": "<Promise.prototype @ 0x536bd441178>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "0",
    "1": "undefined",
    "2": "<Function (anonymous) @ 0x1aa29d500a48>",
    "3": "<PromiseDebugInfo @ 0x1aa29d500998>"
  },
  "properties": {
  }
}

js> dumpValue(new Date());

{
  "type": "object",
  "address": "0x1aa29d500a98",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x10614f1f8 [Date]>",
  "shape": "<0x536bd4739e0, objectFlags=[]>",
  "proto": "<Date.prototype @ 0x536bd4411a8>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "1660049936504 / <private @ 0x4278282afd078000>",
    "1": "undefined",
    "2": "undefined",
    "3": "undefined",
    "4": "undefined",
    "5": "undefined",
    "6": "undefined",
    "7": "undefined"
  },
  "properties": {
  }
}

js> dumpValue(new Map([ ["foo", 10], ["bar", 20] ]));

{
  "type": "object",
  "address": "0x1aa29d500b38",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106136ea8 [Map]>",
  "shape": "<0x536bd473c80, objectFlags=[]>",
  "proto": "<Map.prototype @ 0x536bd4411c0>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2030025334e-314 / <private @ 0x109c5d2b0>",
    "1": "0 / <private @ 0x0>",
    "2": "true"
  },
  "properties": {
  }
}

js> dumpValue(new Set([1, 2, 3]));

{
  "type": "object",
  "address": "0x1aa29d500c48",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x1061372c8 [Set]>",
  "shape": "<0x536bd4750e0, objectFlags=[]>",
  "proto": "<Set.prototype @ 0x536bd4411d8>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.203002573e-314 / <private @ 0x109c5d300>",
    "1": "0 / <private @ 0x0>",
    "2": "true"
  },
  "properties": {
  }
}

js> dumpValue(new WeakMap([ [{}, 10], [{}, 20] ]));

{
  "type": "object",
  "address": "0x536bd43f150",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x10614bd80 [WeakMap]>",
  "shape": "<0x536bd475220, objectFlags=[]>",
  "proto": "<WeakMap.prototype @ 0x536bd4411f0>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2028802027e-314 / <private @ 0x109c20b80>"
  },
  "properties": {
  }
}

js> dumpValue(new WeakSet([{}, {}]));

{
  "type": "object",
  "address": "0x536bd43f178",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x10614c0e8 [WeakSet]>",
  "shape": "<0x536bd475360, objectFlags=[]>",
  "proto": "<WeakSet.prototype @ 0x536bd441208>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.20287893e-314 / <private @ 0x109c20170>"
  },
  "properties": {
  }
}

js> dumpValue(new Proxy({}, {}));

{
  "type": "object",
  "address": "0x536bd442190",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106138970 [Proxy]>",
  "shape": "<0x536bd4753c0, objectFlags=[]>",
  "proto": "<dynamic>",
  "handler": "<0x106138ad0>",
  "private": "<Object @ 0x1aa29d500f58>"
}

js> dumpValue((function* f() {})());

{
  "type": "object",
  "address": "0x1aa29d501098",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x1061403c0 [Generator]>",
  "shape": "<0x536bd475480, objectFlags=[]>",
  "proto": "<Object @ 0x536bd441220>",
  "elementsHeader": "<0x104bf5b50, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "<Function f (/Users/arai/Documents/xpi/mozpatch/dump-value/test.js:96:22 @ 0x536bd46a100) @ 0x1aa29d500fd8>",
    "1": "<Call @ 0x1aa29d501018>",
    "2": "undefined",
    "3": "<Array @ 0x1aa29d5010f8>",
    "4": "0"
  },
  "properties": {
  }
}

dumpValue({
  1: true,
  2: {},
  foo: false,
  bar: null,
  get x() {},
  set x(c) {},
});

{
  "type": "object",
  "address": "0x1aa29d501158",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106137848 [Object]>",
  "shape": "<0x536bd475500, objectFlags=[HasEnumerable, HasNonWritableOrAccessorPropExclProto, HadGetterSetterChange]>",
  "proto": "<Object @ 0x536bd441040>",
  "elementsHeader": "<0x1aa29d501170, flags=[NON_PACKED], init=3, capacity=5, length=0>",
  "properties": {
    "foo": "false (map=0x536bd4708b0, index=0, enumerable, configurable, writable, slot=0)"
    "bar": "null (map=0x536bd4708b0, index=1, enumerable, configurable, writable, slot=1)"
    "x": "getter=0x1aa29d501230, setter=0x1aa29d501270 (map=0x536bd4708b0, index=2, enumerable, configurable, slot=2)"
  },
  "elements": {
    "0": "<magic JS_ELEMENTS_HOLE>",
    "1": "true",
    "2": "<Object @ 0x1aa29d5011b0>"
  }
}

dumpValue([
  true,
  null,
  undefined,
  10,
  1.1,
  10n,
  "foo",
  Symbol.iterator,
  Symbol("foo"),
  Symbol.for("foo"),
  /foo/ig,
  {},
  [],
  Array,
  function f() {},
]);

{
  "type": "object",
  "address": "0x1aa29d5012b0",
  "global": "<global @ 0x536bd43e030>",
  "class": "<0x106135520 [Array]>",
  "shape": "<0x536bd466580, objectFlags=[]>",
  "proto": "<Array @ 0x536bd43e088>",
  "elementsHeader": "<0x1aa29d5012d8, flags=[], init=15, capacity=15, length=15>",
  "properties": {
    "length": "(map=0x536bd45f780, index=0, writable, <custom-data-prop>)"
  },
  "elements": {
    "0": "true",
    "1": "null",
    "2": "undefined",
    "3": "10",
    "4": "1.1 / <private @ 0x3ff199999999999a>",
    "5": "10n @ 0x536bd46b040",
    "6": "'foo' @ (JSAtom*)0x536bd42d480",
    "7": "Symbol.iterator",
    "8": "Symbol('foo') @ 0x536bd471050",
    "9": "Symbol.for('foo') @ 0x536bd471040",
    "10": "<RegExp /foo/gi @ 0x1aa29d501368>",
    "11": "<Object @ 0x1aa29d5013a8>",
    "12": "<Array @ 0x1aa29d5013e8>",
    "13": "<Function Array @ 0x536bd463820>",
    "14": "<Function f (/Users/arai/Documents/xpi/mozpatch/dump-value/test.js:149:12 @ 0x536bd46a1f0) @ 0x1aa29d501448>"
  }
}

```
```
js> dumpValue(true);

{
  "type": "boolean",
  "value": true
}

js> dumpValue(null);

{
  "type": "null"
}

js> dumpValue(undefined);

{
  "type": "undefined"
}

js> dumpValue(10);

{
  "type": "int32",
  "value": 10
}

js> dumpValue(1.1);

{
  "type": "double",
  "value": "1.1",
  "private": "0x3ff199999999999a"
}

js> dumpValue(10n);

{
  "type": "bigint",
  "digitLength": 1,
  "value": "10n"
}

js> dumpValue("foo");

{
  "type": "string",
  "address": "(JSAtom*)0x1093b272d480",
  "flags": [ "ATOM_BIT", "LINEAR_BIT", "INLINE_BIT", "PERMANENT", "LATIN1_CHARS_BIT", "PINNED_ATOM_BIT" ],
  "isTenured": true,
  "length": 3,
  "chars": "(JS::Latin1Char*)0x1093b272d488",
  "value": "foo"
}

js> dumpValue(Symbol.iterator);

{
  "type": "symbol",
  "address": "0x1093b273a040",
  "code": "iterator",
  "description": "Symbol.iterator"
}

js> dumpValue(Symbol("foo"));

{
  "type": "symbol",
  "address": "0x1093b2771030",
  "code": "UniqueSymbol",
  "description": "foo"
}

js> dumpValue(Symbol.for("foo"));

{
  "type": "symbol",
  "address": "0x1093b2771040",
  "code": "InSymbolRegistry",
  "description": "foo"
}

js> dumpValue(/foo/ig);

{
  "type": "object",
  "address": "0xaa548600798",
  "global": "<global @ 0x1093b273e030>",
  "class": "<RegExp @ 0x108647b78>",
  "shape": "<0x1093b276f040, objectFlags=[]>",
  "proto": "<RegExp.prototype @ 0x1093b2741118>",
  "regexpFlags": [ "IgnoreCase", "Global" ],
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "0",
    "1": "'foo' @ (JSAtom*)0x1093b272d480",
    "2": "3",
    "3": "<private GCThing @ 0x1093b2772098>"
  },
  "properties": {
    "lastIndex": "0 (map=0x1093b2744f98, index=0, writable, slot=0)"
  }
}

js> dumpValue({});

{
  "type": "object",
  "address": "0xaa5486007d8",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Object @ 0x10863b848>",
  "shape": "<0x1093b276f060, objectFlags=[]>",
  "proto": "<Object @ 0x1093b2741040>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "properties": {
  }
}

js> dumpValue([]);

{
  "type": "object",
  "address": "0xaa548600818",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Array @ 0x108639520>",
  "shape": "<0x1093b2766580, objectFlags=[]>",
  "proto": "<Array @ 0x1093b273e088>",
  "elementsHeader": "<0xaa548600830, flags=[FIXED], init=0, capacity=6, length=0>",
  "properties": {
    "length": "(map=0x1093b275f780, index=0, writable, <custom-data-prop>)"
  }
}

js> dumpValue(Array);

{
  "type": "object",
  "address": "0x1093b2763820",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Function @ 0x1086456d8>",
  "shape": "<0x1093b2766320, objectFlags=[]>",
  "proto": "<Function (anonymous) @ 0x1093b2743040>",
  "displayAtom": "Array",
  "nargs": 1,
  "functionFlags": [ "NORMAL_KIND", "CONSTRUCTOR" ],
  "native": "0x104d434a8",
  "jitInfo": "0x10714e0b0",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "65664",
    "1": "2.1620230015e-314 / <private @ 0x104d434a8>",
    "2": "2.180695114e-314 / <private @ 0x10714e0b0>",
    "3": "'Array' @ (JSAtom*)0x1093b272c560"
  },
  "properties": {
    "isArray": "<Function isArray @ 0x1093b2763b30> (map=0x1093b2744bf0, index=0, configurable, writable, slot=4)"
    "from": "<Function from @ 0x1093b2745e50> (map=0x1093b2744bf0, index=1, configurable, writable, slot=5)"
    "of": "<Function of @ 0x1093b2763b68> (map=0x1093b2744bf0, index=2, configurable, writable, slot=6)"
    "Symbol.species": "getter=0x1093b2745e98, setter=0x0 (map=0x1093b2744bf0, index=3, configurable, slot=7)"
    "prototype": "<Array @ 0x1093b273e088> (map=0x1093b2744bf0, index=4, slot=8)"
  }
}

js> dumpValue(function f() {});

{
  "type": "object",
  "address": "0xaa548600878",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Function @ 0x1086456d8>",
  "shape": "<0x1093b273d160, objectFlags=[]>",
  "proto": "<Function (anonymous) @ 0x1093b2743040>",
  "displayAtom": "f",
  "baseScript": "test.js:60:20 @ 0x1093b276a060",
  "nargs": 0,
  "functionFlags": [ "NORMAL_KIND", "BASESCRIPT", "CONSTRUCTOR", "LAMBDA" ],
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "672",
    "1": "<LexicalEnvironment @ 0x1093b273f038>",
    "2": "9.0051074322806e-311 / <private @ 0x1093b276a060>",
    "3": "'f' @ (JSAtom*)0x1093b2704d00"
  },
  "properties": {
  }
}

js> dumpValue(new Int8Array([1, 2, 3]));

{
  "type": "object",
  "address": "0xaa5486008b8",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Int8Array @ 0x10864be28>",
  "shape": "<0x1093b276fe20, objectFlags=[]>",
  "proto": "<Int8Array.prototype @ 0x1093b2741160>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "null",
    "1": "1.5e-323 / <private @ 0x3>",
    "2": "0 / <private @ 0x0>",
    "3": "5.7830384512193e-311 / <private @ 0xaa5486008f0>"
  },
  "properties": {
  }
}

js> dumpValue(new Promise(() => {}));

{
  "type": "object",
  "address": "0xaa548600958",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Promise @ 0x108645c70>",
  "shape": "<0x1093b27730a0, objectFlags=[]>",
  "proto": "<Promise.prototype @ 0x1093b2741190>",
  "promiseFlags": [ ],
  "state": "pending",
  "reactions": [
  ],
  "allocationTime": "443.521208",
  "allocationSite": "<SavedFrame @ 0x1093b274d088>",
  "resolutionTime": "0.000000",
  "resolutionSite": "null",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "0",
    "1": "undefined",
    "2": "<Function (anonymous) @ 0xaa548600a48>",
    "3": "<PromiseDebugInfo @ 0xaa548600998>"
  },
  "properties": {
  }
}

js> var p = new Promise(() => {}); p.then(() => {}); dumpValue(p);

{
  "type": "object",
  "address": "0xaa548600ad8",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Promise @ 0x108645c70>",
  "shape": "<0x1093b27730a0, objectFlags=[]>",
  "proto": "<Promise.prototype @ 0x1093b2741190>",
  "promiseFlags": [ "HANDLED" ],
  "state": "pending",
  "reactions": [
    {
      "incumbentGlobal": "<Object @ 0x1093b2741040>",
      "flags": [ ]
    }
  ],
  "allocationTime": "500.370542",
  "allocationSite": "<SavedFrame @ 0x1093b274d0e0>",
  "resolutionTime": "0.000000",
  "resolutionSite": "null",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "4",
    "1": "<PromiseReactionRecord @ 0xaa548600c58>",
    "2": "<Function (anonymous) @ 0xaa548600bc8>",
    "3": "<PromiseDebugInfo @ 0xaa548600b18>"
  },
  "properties": {
  }
}

js> p.then(() => {}); dumpValue(p);

{
  "type": "object",
  "address": "0xaa548600ad8",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Promise @ 0x108645c70>",
  "shape": "<0x1093b27730a0, objectFlags=[]>",
  "proto": "<Promise.prototype @ 0x1093b2741190>",
  "promiseFlags": [ "HANDLED" ],
  "state": "pending",
  "reactions": [
    {
      "incumbentGlobal": "<Object @ 0x1093b2741040>",
      "flags": [ ]
    },
    {
      "incumbentGlobal": "<Object @ 0x1093b2741040>",
      "flags": [ ]
    }
  ],
  "allocationTime": "500.370542",
  "allocationSite": "<SavedFrame @ 0x1093b274d0e0>",
  "resolutionTime": "0.000000",
  "resolutionSite": "null",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "4",
    "1": "<Array @ 0xaa548600d58>",
    "2": "<Function (anonymous) @ 0xaa548600bc8>",
    "3": "<PromiseDebugInfo @ 0xaa548600b18>"
  },
  "properties": {
  }
}

js> dumpValue(Promise.resolve(10));

{
  "type": "object",
  "address": "0xaa548600d98",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Promise @ 0x108645c70>",
  "shape": "<0x1093b27730a0, objectFlags=[]>",
  "proto": "<Promise.prototype @ 0x1093b2741190>",
  "promiseFlags": [ "RESOLVED", "FULFILLED", "DEFAULT_RESOLVING_FUNCTIONS", "DEFAULT_RESOLVING_FUNCTIONS_ALREADY_RESOLVED" ],
  "state": "fulfilled",
  "value": {
    "type": "int32",
    "value": 10
  },
  "allocationTime": "625.029125",
  "allocationSite": "<SavedFrame @ 0x1093b274d138>",
  "resolutionTime": "625.174458",
  "resolutionSite": "<SavedFrame @ 0x1093b274d138>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "27",
    "1": "10",
    "2": "undefined",
    "3": "<PromiseDebugInfo @ 0xaa548600dd8>"
  },
  "properties": {
  }
}

js> dumpValue(Promise.reject(10));

{
  "type": "object",
  "address": "0xaa548600e38",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Promise @ 0x108645c70>",
  "shape": "<0x1093b27730a0, objectFlags=[]>",
  "proto": "<Promise.prototype @ 0x1093b2741190>",
  "promiseFlags": [ "RESOLVED", "DEFAULT_RESOLVING_FUNCTIONS", "DEFAULT_RESOLVING_FUNCTIONS_ALREADY_RESOLVED" ],
  "state": "rejected",
  "reason": {
    "type": "int32",
    "value": 10
  },
  "allocationTime": "687.134250",
  "allocationSite": "<SavedFrame @ 0x1093b274d190>",
  "resolutionTime": "687.202667",
  "resolutionSite": "<SavedFrame @ 0x1093b274d190>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "25",
    "1": "10",
    "2": "undefined",
    "3": "<PromiseDebugInfo @ 0xaa548600e78>"
  },
  "properties": {
  }
}

js> dumpValue((async function() {})());

{
  "type": "object",
  "address": "0xaa548601088",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Promise @ 0x108645c70>",
  "shape": "<0x1093b27730a0, objectFlags=[]>",
  "proto": "<Promise.prototype @ 0x1093b2741190>",
  "promiseFlags": [ "RESOLVED", "FULFILLED", "DEFAULT_RESOLVING_FUNCTIONS", "ASYNC" ],
  "state": "fulfilled",
  "value": {
    "type": "undefined"
  },
  "allocationTime": "690.137583",
  "allocationSite": "<SavedFrame @ 0x1093b274d240>",
  "resolutionTime": "690.287083",
  "resolutionSite": "<SavedFrame @ 0x1093b274d240>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "43",
    "1": "undefined",
    "2": "undefined",
    "3": "<PromiseDebugInfo @ 0xaa5486010c8>"
  },
  "properties": {
  }
}

js> dumpValue(new Date());

{
  "type": "object",
  "address": "0xaa5486011c8",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Date @ 0x1086531f8>",
  "shape": "<0x1093b2773d40, objectFlags=[]>",
  "proto": "<Date.prototype @ 0x1093b27411d8>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "1660118396079 / <private @ 0x4278286c46caf000>",
    "1": "undefined",
    "2": "undefined",
    "3": "undefined",
    "4": "undefined",
    "5": "undefined",
    "6": "undefined",
    "7": "undefined"
  },
  "properties": {
  }
}

js> dumpValue(new Map([ ["foo", 10], ["bar", 20] ]));

{
  "type": "object",
  "address": "0xaa548601268",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Map @ 0x10863aea8>",
  "shape": "<0x1093b2773fa0, objectFlags=[]>",
  "proto": "<Map.prototype @ 0x1093b27411f0>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2221702805e-314 / <private @ 0x10c15cd60>",
    "1": "0 / <private @ 0x0>",
    "2": "true"
  },
  "properties": {
  }
}

js> dumpValue(new Set([1, 2, 3]));

{
  "type": "object",
  "address": "0xaa548601378",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Set @ 0x10863b2c8>",
  "shape": "<0x1093b2773580, objectFlags=[]>",
  "proto": "<Set.prototype @ 0x1093b27411c0>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2221707152e-314 / <private @ 0x10c15d0d0>",
    "1": "0 / <private @ 0x0>",
    "2": "true"
  },
  "properties": {
  }
}

js> dumpValue(new WeakMap([ [{}, 10], [{}, 20] ]));

{
  "type": "object",
  "address": "0x1093b273f150",
  "global": "<global @ 0x1093b273e030>",
  "class": "<WeakMap @ 0x10864fd80>",
  "shape": "<0x1093b2775300, objectFlags=[]>",
  "proto": "<WeakMap.prototype @ 0x1093b2741208>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2220481237e-314 / <private @ 0x10c120790>"
  },
  "properties": {
  }
}

js> dumpValue(new WeakSet([{}, {}]));

{
  "type": "object",
  "address": "0x1093b273f178",
  "global": "<global @ 0x1093b273e030>",
  "class": "<WeakSet @ 0x1086500e8>",
  "shape": "<0x1093b2775440, objectFlags=[]>",
  "proto": "<WeakSet.prototype @ 0x1093b2741220>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2220484557e-314 / <private @ 0x10c120a30>"
  },
  "properties": {
  }
}

js> dumpValue(new Proxy({}, {}));

{
  "type": "object",
  "address": "0x1093b2742190",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Proxy @ 0x10863c970>",
  "shape": "<0x1093b27754a0, objectFlags=[]>",
  "proto": "<dynamic>",
  "handler": "<0x10863cad0>",
  "private": "<Object @ 0xaa548601688>"
}

js> dumpValue((function* f() {})());

{
  "type": "object",
  "address": "0xaa5486017c8",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Generator @ 0x1086443c0>",
  "shape": "<0x1093b2775540, objectFlags=[]>",
  "proto": "<Object @ 0x1093b2741238>",
  "elementsHeader": "<0x1070f6bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "<Function f (test.js:118:22 @ 0x1093b276a290) @ 0xaa548601708>",
    "1": "<Call @ 0xaa548601748>",
    "2": "undefined",
    "3": "<Array @ 0xaa548601828>",
    "4": "0"
  },
  "properties": {
  }
}

dumpValue({
  1: true,
  2: {},
  foo: false,
  bar: null,
  get x() {},
  set x(c) {},
});

{
  "type": "object",
  "address": "0xaa548601888",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Object @ 0x10863b848>",
  "shape": "<0x1093b27755c0, objectFlags=[HasEnumerable, HasNonWritableOrAccessorPropExclProto, HadGetterSetterChange]>",
  "proto": "<Object @ 0x1093b2741040>",
  "elementsHeader": "<0xaa5486018a0, flags=[NON_PACKED], init=3, capacity=5, length=0>",
  "properties": {
    "foo": "false (map=0x1093b2770918, index=0, enumerable, configurable, writable, slot=0)"
    "bar": "null (map=0x1093b2770918, index=1, enumerable, configurable, writable, slot=1)"
    "x": "getter=0xaa548601960, setter=0xaa5486019a0 (map=0x1093b2770918, index=2, enumerable, configurable, slot=2)"
  },
  "elements": {
    "0": "<magic JS_ELEMENTS_HOLE>",
    "1": "true",
    "2": "<Object @ 0xaa5486018e0>"
  }
}

dumpValue([
  true,
  null,
  undefined,
  10,
  1.1,
  10n,
  "foo",
  Symbol.iterator,
  Symbol("foo"),
  Symbol.for("foo"),
  /foo/ig,
  {},
  [],
  Array,
  function f() {},
]);

{
  "type": "object",
  "address": "0xaa5486019e0",
  "global": "<global @ 0x1093b273e030>",
  "class": "<Array @ 0x108639520>",
  "shape": "<0x1093b2766580, objectFlags=[]>",
  "proto": "<Array @ 0x1093b273e088>",
  "elementsHeader": "<0xaa548601a08, flags=[], init=15, capacity=15, length=15>",
  "properties": {
    "length": "(map=0x1093b275f780, index=0, writable, <custom-data-prop>)"
  },
  "elements": {
    "0": "true",
    "1": "null",
    "2": "undefined",
    "3": "10",
    "4": "1.1 / <private @ 0x3ff199999999999a>",
    "5": "10n @ 0x1093b276b040",
    "6": "'foo' @ (JSAtom*)0x1093b272d480",
    "7": "Symbol.iterator",
    "8": "Symbol('foo') @ 0x1093b2771050",
    "9": "Symbol.for('foo') @ 0x1093b2771040",
    "10": "<RegExp /foo/gi @ 0xaa548601a98>",
    "11": "<Object @ 0xaa548601ad8>",
    "12": "<Array @ 0xaa548601b18>",
    "13": "<Function Array @ 0x1093b2763820>",
    "14": "<Function f (test.js:171:12 @ 0x1093b276a380) @ 0xaa548601b78>"
  }
}
```
```
js> dumpValue(true);

{
  "type": "boolean",
  "value": true
}

js> dumpValue(null);

{
  "type": "null"
}

js> dumpValue(undefined);

{
  "type": "undefined"
}

js> dumpValue(10);

{
  "type": "int32",
  "value": 10
}

js> dumpValue(1.1);

{
  "type": "double",
  "value": "1.1",
  "private": "0x3ff199999999999a"
}

js> dumpValue(10n);

{
  "type": "bigint",
  "address": "(JS::BigInt*)0x11199796b030",
  "digitLength": 1,
  "value": "10n"
}

js> dumpValue("foo");

{
  "type": "string",
  "address": "(JSAtom*)0x11199792d440",
  "flags": [ "ATOM_BIT", "LINEAR_BIT", "INLINE_BIT", "PERMANENT", "LATIN1_CHARS_BIT", "PINNED_ATOM_BIT" ],
  "isTenured": true,
  "length": 3,
  "chars": "(JS::Latin1Char*)0x11199792d448",
  "value": "foo"
}

js> dumpValue(Symbol.iterator);

{
  "type": "symbol",
  "address": "(JS::Symbol*)0x11199793a040",
  "code": "iterator",
  "description": "Symbol.iterator"
}

js> dumpValue(Symbol("foo"));

{
  "type": "symbol",
  "address": "(JS::Symbol*)0x11199796c030",
  "code": "UniqueSymbol",
  "description": "foo"
}

js> dumpValue(Symbol.for("foo"));

{
  "type": "symbol",
  "address": "(JS::Symbol*)0x11199796c040",
  "code": "InSymbolRegistry",
  "description": "foo"
}

js> dumpValue(/foo/ig);

{
  "type": "object",
  "address": "(JSObject*)0x203dde901158",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<RegExp @ (JSClass*)0x105e2bc00>",
  "shape": "<(js::Shape*)0x111997966fe0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c298",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x1119979410d0"
  },
  "source": "foo",
  "flags": [ "IgnoreCase", "Global" ],
  "lastIndex": "0",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "0",
    "1": "'foo' @ (JSAtom*)0x11199792d440",
    "2": "3",
    "3": "<private GCThing @ 0x111997971098>"
  },
  "properties": {
    "lastIndex": "0 (map=(js::CompactPropMap*)0x111997944f30, index=0, writable, slot=0)"
  }
}

js> dumpValue({});

{
  "type": "object",
  "address": "(JSObject*)0x203dde901278",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Object @ (JSClass*)0x105e1f8e8>",
  "shape": "<(js::Shape*)0x111997972040, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c0e8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941040"
  },
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "properties": {
  }
}

js> dumpValue([]);

{
  "type": "object",
  "address": "(JSObject*)0x203dde901398",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Array @ (JSClass*)0x105e1d520>",
  "shape": "<(js::Shape*)0x111997966500, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c220",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x11199793e088"
  },
  "elementsHeader": "<(js::ObjectElements*)0x203dde9013b0, flags=[FIXED], init=0, capacity=6, length=0>",
  "properties": {
    "length": "(map=(js::NormalPropMap*)0x11199795f780, index=0, writable, <custom-data-prop>)"
  }
}

js> dumpValue(Array);

{
  "type": "object",
  "address": "(JSObject*)0x111997963820",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Function @ (JSClass*)0x105e29760>",
  "shape": "<(js::Shape*)0x1119979662a0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c0a0",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997943040"
  },
  "displayAtom": "Array",
  "nargs": 1,
  "flags": [ "NORMAL_KIND", "CONSTRUCTOR" ],
  "native": "0x1024e63d8",
  "jitInfo": "0x104930578",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "65664",
    "1": "2.14111208e-314 / <private @ 0x1024e63d8>",
    "2": "2.1599123926e-314 / <private @ 0x104930578>",
    "3": "'Array' @ (JSAtom*)0x11199792c520"
  },
  "properties": {
    "isArray": "<Function isArray @ (JSObject*)0x111997963b30> (map=(js::CompactPropMap*)0x111997944bf0, index=0, configurable, writable, slot=4)"
    "from": "<Function from @ (JSObject*)0x111997945dc0> (map=(js::CompactPropMap*)0x111997944bf0, index=1, configurable, writable, slot=5)"
    "of": "<Function of @ (JSObject*)0x111997963b68> (map=(js::CompactPropMap*)0x111997944bf0, index=2, configurable, writable, slot=6)"
    "Symbol.species": "getter=0x111997945e08, setter=0x0 (map=(js::CompactPropMap*)0x111997944bf0, index=3, configurable, slot=7)"
    "prototype": "<Array @ (JSObject*)0x11199793e088> (map=(js::CompactPropMap*)0x111997944bf0, index=4, slot=8)"
  }
}

js> dumpValue(function f() {});

{
  "type": "object",
  "address": "(JSObject*)0x203dde9015b0",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Function @ (JSClass*)0x105e29760>",
  "shape": "<(js::Shape*)0x11199793d160, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c0a0",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997943040"
  },
  "displayAtom": "f",
  "baseScript": "/Users/arai/Documents/xpi/mozpatch/dump-value/test.js line 3 > eval:1:20 @ 0x11199796a560",
  "nargs": 0,
  "flags": [ "NORMAL_KIND", "BASESCRIPT", "CONSTRUCTOR", "LAMBDA" ],
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "672",
    "1": "<Call @ (JSObject*)0x203dde9014d8>",
    "2": "9.2892321007895e-311 / <private @ 0x11199796a560>",
    "3": "'f' @ (JSAtom*)0x111997904d00"
  },
  "properties": {
  }
}

js> dumpValue(new Int8Array([1, 2, 3]));

{
  "type": "object",
  "address": "(JSObject*)0x203dde9016c8",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Int8Array @ (JSClass*)0x105e2fe60>",
  "shape": "<(js::Shape*)0x111997972b20, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c328",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941100"
  },
  "length": "3",
  "byteOffset": "0",
  "data": "0x203dde901700",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "null",
    "1": "1.5e-323 / <private @ 0x3>",
    "2": "0 / <private @ 0x0>",
    "3": "1.7514676096559e-310 / <private @ 0x203dde901700>"
  },
  "properties": {
  }
}

js> dumpValue(new Int8Array(new Int8Array([1, 2, 3]).buffer, 1));

{
  "type": "object",
  "address": "(JSObject*)0x203dde901860",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Int8Array @ (JSClass*)0x105e2fe60>",
  "shape": "<(js::Shape*)0x111997972b20, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c328",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941100"
  },
  "length": "2",
  "byteOffset": "1",
  "data": "0x111997974069",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "<ArrayBuffer byteLength=3, bufferKind=INLINE_DATA, flags=[], data=0x111997974068 @ (JSObject*)0x111997974030>",
    "1": "1e-323 / <private @ 0x2>",
    "2": "5e-324 / <private @ 0x1>",
    "3": "9.2892321203985e-311 / <private @ 0x111997974069>"
  },
  "properties": {
  }
}

js> dumpValue(new Int32Array([1, 2, 3]));

{
  "type": "object",
  "address": "(JSObject*)0x203dde901978",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Int32Array @ (JSClass*)0x105e2ff20>",
  "shape": "<(js::Shape*)0x111997972d80, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c388",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941160"
  },
  "length": "3",
  "byteOffset": "0",
  "data": "0x203dde9019b0",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "null",
    "1": "1.5e-323 / <private @ 0x3>",
    "2": "0 / <private @ 0x0>",
    "3": "1.7514676096899e-310 / <private @ 0x203dde9019b0>"
  },
  "properties": {
  }
}

js> dumpValue(new Int32Array(new Int32Array([1, 2, 3]).buffer, 4));

{
  "type": "object",
  "address": "(JSObject*)0x203dde901b10",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Int32Array @ (JSClass*)0x105e2ff20>",
  "shape": "<(js::Shape*)0x111997972d80, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c388",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941160"
  },
  "length": "2",
  "byteOffset": "4",
  "data": "0x1119979740c4",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "<ArrayBuffer byteLength=12, bufferKind=INLINE_DATA, flags=[], data=0x1119979740c0 @ (JSObject*)0x111997974088>",
    "1": "1e-323 / <private @ 0x2>",
    "2": "2e-323 / <private @ 0x4>",
    "3": "9.2892321204434e-311 / <private @ 0x1119979740c4>"
  },
  "properties": {
  }
}

js> dumpValue(new Int8Array([1, 2, 3]).buffer);

{
  "type": "object",
  "address": "(JSObject*)0x1119979740e0",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<ArrayBuffer @ (JSClass*)0x105e21340>",
  "shape": "<(js::Shape*)0x111997972cc0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c358",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941148"
  },
  "byteLength": "3",
  "bufferKind": "INLINE_DATA",
  "flags": [ ],
  "data": "0x111997974118",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "9.289232120485e-311 / <private @ 0x111997974118>",
    "1": "1.5e-323 / <private @ 0x3>",
    "2": "<Int8Array length=3, byteOffset=0, data=0x111997974118 @ (JSObject*)0x203dde901c28>",
    "3": "0"
  },
  "properties": {
  }
}

js> dumpValue(new Promise(() => {}));

{
  "type": "object",
  "address": "(JSObject*)0x203dde901da0",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Promise @ (JSClass*)0x105e29cf8>",
  "shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c3b8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941178"
  },
  "flags": [ ],
  "state": "pending",
  "reactions": [
  ],
  "allocationTime": "591.630542",
  "allocationSite": "<SavedFrame @ (JSObject*)0x11199794d138>",
  "resolutionTime": "0.000000",
  "resolutionSite": "null",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "0",
    "1": "undefined",
    "2": "<Function (anonymous) @ (JSObject*)0x203dde901e90>",
    "3": "<PromiseDebugInfo @ (JSObject*)0x203dde901de0>"
  },
  "properties": {
  }
}

js> var p = new Promise(() => {}); p.then(() => {}); dumpValue(p);

{
  "type": "object",
  "address": "(JSObject*)0x203dde901ff8",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Promise @ (JSClass*)0x105e29cf8>",
  "shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c3b8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941178"
  },
  "flags": [ "HANDLED" ],
  "state": "pending",
  "reactions": [
    {
      "promise": "<Promise  @ (JSObject*)0x203dde902178>",
      "incumbentGlobal": "<Object @ (JSObject*)0x111997941040>",
      "flags": [ ]
    }
  ],
  "allocationTime": "652.663083",
  "allocationSite": "<SavedFrame @ (JSObject*)0x11199794d240>",
  "resolutionTime": "0.000000",
  "resolutionSite": "null",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "4",
    "1": "<PromiseReactionRecord @ (JSObject*)0x203dde902218>",
    "2": "<Function (anonymous) @ (JSObject*)0x203dde9020e8>",
    "3": "<PromiseDebugInfo @ (JSObject*)0x203dde902038>"
  },
  "properties": {
  }
}

js> var p = new Promise(() => {}); p.then(() => {}); p.then(() => {}); dumpValue(p);

{
  "type": "object",
  "address": "(JSObject*)0x203dde902390",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Promise @ (JSClass*)0x105e29cf8>",
  "shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c3b8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941178"
  },
  "flags": [ "HANDLED" ],
  "state": "pending",
  "reactions": [
    {
      "promise": "<Promise  @ (JSObject*)0x203dde902510>",
      "incumbentGlobal": "<Object @ (JSObject*)0x111997941040>",
      "flags": [ ]
    },
    {
      "promise": "<Promise  @ (JSObject*)0x203dde902650>",
      "incumbentGlobal": "<Object @ (JSObject*)0x111997941040>",
      "flags": [ ]
    }
  ],
  "allocationTime": "711.244417",
  "allocationSite": "<SavedFrame @ (JSObject*)0x11199794d3a0>",
  "resolutionTime": "0.000000",
  "resolutionSite": "null",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "4",
    "1": "<Array @ (JSObject*)0x203dde902750>",
    "2": "<Function (anonymous) @ (JSObject*)0x203dde902480>",
    "3": "<PromiseDebugInfo @ (JSObject*)0x203dde9023d0>"
  },
  "properties": {
  }
}

js> dumpValue(Promise.resolve(10));

{
  "type": "object",
  "address": "(JSObject*)0x203dde902868",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Promise @ (JSClass*)0x105e29cf8>",
  "shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c3b8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941178"
  },
  "flags": [ "RESOLVED", "FULFILLED", "DEFAULT_RESOLVING_FUNCTIONS", "DEFAULT_RESOLVING_FUNCTIONS_ALREADY_RESOLVED" ],
  "state": "fulfilled",
  "value": {
    "type": "int32",
    "value": 10
  },
  "allocationTime": "717.482875",
  "allocationSite": "<SavedFrame @ (JSObject*)0x11199794d558>",
  "resolutionTime": "717.531500",
  "resolutionSite": "<SavedFrame @ (JSObject*)0x11199794d558>",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "27",
    "1": "10",
    "2": "undefined",
    "3": "<PromiseDebugInfo @ (JSObject*)0x203dde9028a8>"
  },
  "properties": {
  }
}

js> var p = Promise.reject(10); dumpValue(p);

{
  "type": "object",
  "address": "(JSObject*)0x203dde9029e0",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Promise @ (JSClass*)0x105e29cf8>",
  "shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c3b8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941178"
  },
  "flags": [ "RESOLVED", "DEFAULT_RESOLVING_FUNCTIONS", "DEFAULT_RESOLVING_FUNCTIONS_ALREADY_RESOLVED" ],
  "state": "rejected",
  "reason": {
    "type": "int32",
    "value": 10
  },
  "allocationTime": "756.589917",
  "allocationSite": "<SavedFrame @ (JSObject*)0x11199794d660>",
  "resolutionTime": "756.620458",
  "resolutionSite": "<SavedFrame @ (JSObject*)0x11199794d660>",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "25",
    "1": "10",
    "2": "undefined",
    "3": "<PromiseDebugInfo @ (JSObject*)0x203dde902a20>"
  },
  "properties": {
  }
}

js> dumpValue((async function() {})());

{
  "type": "object",
  "address": "(JSObject*)0x203dde902c18",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Promise @ (JSClass*)0x105e29cf8>",
  "shape": "<(js::Shape*)0x111997972fc0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c3b8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941178"
  },
  "flags": [ "RESOLVED", "FULFILLED", "DEFAULT_RESOLVING_FUNCTIONS", "ASYNC" ],
  "state": "fulfilled",
  "value": {
    "type": "undefined"
  },
  "allocationTime": "818.985458",
  "allocationSite": "<SavedFrame @ (JSObject*)0x11199794d7c0>",
  "resolutionTime": "819.177167",
  "resolutionSite": "<SavedFrame @ (JSObject*)0x11199794d7c0>",
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "43",
    "1": "undefined",
    "2": "undefined",
    "3": "<PromiseDebugInfo @ (JSObject*)0x203dde902c58>"
  },
  "properties": {
  }
}

js> dumpValue(new Date());

{
  "type": "object",
  "address": "(JSObject*)0x203dde902e30",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Date @ (JSClass*)0x105e37250>",
  "shape": "<(js::Shape*)0x111997975de0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c4d8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x1119979411d8"
  },
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "1660745415458 / <private @ 0x42782ac23fb22000>",
    "1": "undefined",
    "2": "undefined",
    "3": "undefined",
    "4": "undefined",
    "5": "undefined",
    "6": "undefined",
    "7": "undefined"
  },
  "properties": {
  }
}

js> dumpValue(new Map([ ["foo", 10], ["bar", 20] ]));

{
  "type": "object",
  "address": "(JSObject*)0x203dde902fa8",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Map @ (JSClass*)0x105e1ef48>",
  "shape": "<(js::Shape*)0x111997977080, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c508",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x1119979411f0"
  },
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.201448021e-314 / <private @ 0x10995d030>",
    "1": "0 / <private @ 0x0>",
    "2": "true"
  },
  "properties": {
  }
}

js> dumpValue(new Set([1, 2, 3]));

{
  "type": "object",
  "address": "(JSObject*)0x203dde903190",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Set @ (JSClass*)0x105e1f368>",
  "shape": "<(js::Shape*)0x111997975500, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c448",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x1119979411a8"
  },
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2014473886e-314 / <private @ 0x10995cb30>",
    "1": "0 / <private @ 0x0>",
    "2": "true"
  },
  "properties": {
  }
}

js> dumpValue(new WeakMap([ [{}, 10], [{}, 20] ]));

{
  "type": "object",
  "address": "(JSObject*)0x11199793f150",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<WeakMap @ (JSClass*)0x105e33db8>",
  "shape": "<(js::Shape*)0x1119979773a0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c550",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941208"
  },
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.201325232e-314 / <private @ 0x109920560>"
  },
  "properties": {
  }
}

js> dumpValue(new WeakSet([{}, {}]));

{
  "type": "object",
  "address": "(JSObject*)0x11199793f178",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<WeakSet @ (JSClass*)0x105e34120>",
  "shape": "<(js::Shape*)0x1119979774e0, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c580",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941220"
  },
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "2.2013261726e-314 / <private @ 0x109920cd0>"
  },
  "properties": {
  }
}

js> dumpValue(new Proxy({}, {}));

{
  "type": "object",
  "address": "(JSObject*)0x111997942190",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Proxy @ (JSClass*)0x105e20a10>",
  "shape": "<(js::Shape*)0x111997977540, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c598",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "<dynamic>"
  },
  "handler": "(js::BaseProxyHandler*)0x105e20b70",
  "private": "<Object @ (JSObject*)0x203dde903728>"
}

js> dumpValue((function* f() {})());

{
  "type": "object",
  "address": "(JSObject*)0x203dde903940",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Generator @ (JSClass*)0x105e28448>",
  "shape": "<(js::Shape*)0x111997977780, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c5f8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941268"
  },
  "elementsHeader": "<(js::ObjectElements*)0x1048d8bd0, flags=[], init=0, capacity=0, length=0>",
  "reservedSlots": {
    "0": "<Function f (/Users/arai/Documents/xpi/mozpatch/dump-value/test.js line 3 > eval:1:22 @ 0x11199796af10) @ (JSObject*)0x203dde903880>",
    "1": "<Call @ (JSObject*)0x203dde9038c0>",
    "2": "undefined",
    "3": "<Array @ (JSObject*)0x203dde9039a0>",
    "4": "0"
  },
  "properties": {
  }
}

js> dumpValue({
  1: true,
  2: {},
  foo: false,
  bar: null,
  get x() {},
  set x(c) {},
});

{
  "type": "object",
  "address": "(JSObject*)0x203dde903ad8",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Object @ (JSClass*)0x105e1f8e8>",
  "shape": "<(js::Shape*)0x111997977800, objectFlags=[HasEnumerable, HasNonWritableOrAccessorPropExclProto, HadGetterSetterChange]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c0e8",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x111997941040"
  },
  "elementsHeader": "<(js::ObjectElements*)0x203dde903af0, flags=[NON_PACKED], init=3, capacity=5, length=0>",
  "properties": {
    "foo": "false (map=(js::CompactPropMap*)0x111997973a50, index=0, enumerable, configurable, writable, slot=0)"
    "bar": "null (map=(js::CompactPropMap*)0x111997973a50, index=1, enumerable, configurable, writable, slot=1)"
    "x": "getter=0x203dde903bb0, setter=0x203dde903bf0 (map=(js::CompactPropMap*)0x111997973a50, index=2, enumerable, configurable, slot=2)"
  },
  "elements": {
    "0": "<magic JS_ELEMENTS_HOLE>",
    "1": "true",
    "2": "<Object @ (JSObject*)0x203dde903b30>"
  }
}

js> dumpValue([
  true,
  null,
  undefined,
  10,
  1.1,
  10n,
  "foo",
  Symbol.iterator,
  Symbol("foo"),
  Symbol.for("foo"),
  /foo/ig,
  {},
  [],
  Array,
  function f() {},
  new Int8Array([1, 2, 3]),
  new Int8Array([1, 2, 3]).buffer,
]);

{
  "type": "object",
  "address": "(JSObject*)0x203dde903d08",
  "nonCCWGlobal": "<global @ (JSObject*)0x11199793e030>",
  "clasp": "<Array @ (JSClass*)0x105e1d520>",
  "shape": "<(js::Shape*)0x111997966500, objectFlags=[]>",
  "shape.base": {
    "address": "(js::BaseShape*)0x11199793c220",
    "realm": "(JS::Realm*)0x109916000",
    "proto": "(JSObject*)0x11199793e088"
  },
  "elementsHeader": "<(js::ObjectElements*)0x203dde903d30, flags=[], init=17, capacity=17, length=17>",
  "properties": {
    "length": "(map=(js::NormalPropMap*)0x11199795f780, index=0, writable, <custom-data-prop>)"
  },
  "elements": {
    "0": "true",
    "1": "null",
    "2": "undefined",
    "3": "10",
    "4": "1.1 / <private @ 0x3ff199999999999a>",
    "5": "10n @ (JS::BigInt*)0x11199796b040",
    "6": "'foo' @ (JSAtom*)0x11199792d440",
    "7": "Symbol.iterator",
    "8": "Symbol('foo') @ (JS::Symbol*)0x11199796c050",
    "9": "Symbol.for('foo') @ (JS::Symbol*)0x11199796c040",
    "10": "<RegExp /foo/ig @ (JSObject*)0x203dde903dd0>",
    "11": "<Object @ (JSObject*)0x203dde903e10>",
    "12": "<Array @ (JSObject*)0x203dde903e50>",
    "13": "<Function Array @ (JSObject*)0x111997963820>",
    "14": "<Function f (/Users/arai/Documents/xpi/mozpatch/dump-value/test.js line 3 > eval:16:12 @ 0x111997979100) @ (JSObject*)0x203dde903eb0>",
    "15": "<Int8Array length=3, byteOffset=0, data=0x203dde903f28 @ (JSObject*)0x203dde903ef0>",
    "16": "<ArrayBuffer byteLength=3, bufferKind=INLINE_DATA, flags=[], data=0x111997974170 @ (JSObject*)0x111997974138>"
  }
}
```

Back to Bug 1783397 Comment 3