mirror of https://github.com/boa-dev/boa.git
Browse Source
This PR makes `JsValue` (object) only display owned properties, cleans up object printing. This can be toggled with `value.display().internals(true)` `>> ({x: 1, y: ""})` _Before:_ <details> <pre> { x: 1, y: "", __proto__: { hasOwnProperty: { length: 1, name: "hasOwnProperty", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, propertyIsEnumerable: { length: 1, name: "propertyIsEnumerable", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, toString: { length: 0, name: "toString", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, valueOf: { length: 0, name: "valueOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isPrototypeOf: { length: 1, name: "isPrototypeOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, constructor: { create: { length: 2, name: "create", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, setPrototypeOf: { length: 2, name: "setPrototypeOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getPrototypeOf: { length: 1, name: "getPrototypeOf", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, defineProperty: { length: 3, name: "defineProperty", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, defineProperties: { length: 2, name: "defineProperties", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, assign: { length: 2, name: "assign", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, is: { length: 2, name: "is", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, keys: { length: 1, name: "keys", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, values: { length: 1, name: "values", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, entries: { length: 1, name: "entries", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, seal: { length: 1, name: "seal", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isSealed: { length: 1, name: "isSealed", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, freeze: { length: 1, name: "freeze", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isFrozen: { length: 1, name: "isFrozen", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, preventExtensions: { length: 1, name: "preventExtensions", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, isExtensible: { length: 1, name: "isExtensible", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertyDescriptor: { length: 2, name: "getOwnPropertyDescriptor", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertyDescriptors: { length: 1, name: "getOwnPropertyDescriptors", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertyNames: { length: 1, name: "getOwnPropertyNames", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, getOwnPropertySymbols: { length: 1, name: "getOwnPropertySymbols", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, hasOwn: { length: 2, name: "hasOwn", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, fromEntries: { length: 1, name: "fromEntries", __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, length: 1, name: "Object", prototype: [Cycle], __proto__: { name: "", length: 0, apply: { length: 1, name: "apply", __proto__: [Cycle] }, bind: { length: 1, name: "bind", __proto__: [Cycle] }, call: { length: 1, name: "call", __proto__: [Cycle] }, toString: { length: 0, name: "toString", __proto__: [Cycle] }, constructor: { length: 1, name: "Function", prototype: [Cycle], __proto__: [Cycle] }, Symbol(Symbol.hasInstance): { length: 1, name: "[Symbol.iterator]", __proto__: [Cycle] }, __proto__: [Cycle] } }, __proto__: null } } </pre> </details> _After:_ ```text { x: 1, y: "" } ```pull/1854/head
Halid Odat
3 years ago
3 changed files with 27 additions and 4 deletions
Loading…
Reference in new issue