b1f5eeabe5
This is a reland of 2b94e5677f
Original change's description:
> [inspector] Report [[Prototype]] as internal property.
>
> Previously the inspector was trying to add a special `__proto__`
> property to every JSObject, which looked and behaved like a real
> data property on the object. But this is confusing to developers
> since `__proto__` is not a real data property, but usually an
> accessor property on the `Object.prototype`.
>
> Additionally all other internal properties are reported using the
> [[Name]] notation, with the [[Prototype]] having been the strange
> outlier.
>
> Drive-by-cleanup: Use an ArrayList to collect the name/value pairs
> inside Runtime::GetInternalProperties(), which makes this function
> more readable and easier to add things.
>
> Bug: chromuium:1162229
> Fixed: chromium:1197019
> Screenshot: https://imgur.com/a/b7TZ32s.png
> Change-Id: Ic4c1e35e2e65f90619fcc12bf3a72806cadb0794
> Doc: http://doc/1Xetnc9s6r0yy4LnPbqeCwsnsOtBlvJsV4OCdXMZ1wCM
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2814565
> Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73881}
Bug: chromuium:1162229, chromium:1197019
Screenshot: https://imgur.com/a/b7TZ32s.png
Doc: http://doc/1Xetnc9s6r0yy4LnPbqeCwsnsOtBlvJsV4OCdXMZ1wCM
Change-Id: Ie1e2276b385b18a5f865fdae583d1ce0101157c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2820970
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73899}
756 lines
20 KiB
Plaintext
756 lines
20 KiB
Plaintext
Checks internal properties in Runtime.getProperties output
|
|
|
|
Running test: generatorFunction
|
|
expression: (function* foo() { yield 1 })
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[FunctionLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 14
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[IsGenerator]]
|
|
value : {
|
|
type : boolean
|
|
value : true
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : GeneratorFunction
|
|
description : GeneratorFunction
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[Scopes]]
|
|
value : {
|
|
className : Array
|
|
description : Scopes[1]
|
|
objectId : <objectId>
|
|
subtype : internal#scopeList
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
Running test: regularFunction
|
|
expression: (function foo() {})
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[FunctionLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 13
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Function
|
|
description : function () { [native code] }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[Scopes]]
|
|
value : {
|
|
className : Array
|
|
description : Scopes[1]
|
|
objectId : <objectId>
|
|
subtype : internal#scopeList
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
Running test: boxedObjects
|
|
expression: new Number(239)
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Number
|
|
description : Number
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[PrimitiveValue]]
|
|
value : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: new Boolean(false)
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Boolean
|
|
description : Boolean
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[PrimitiveValue]]
|
|
value : {
|
|
type : boolean
|
|
value : false
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: new String('abc')
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : String
|
|
description : String
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[PrimitiveValue]]
|
|
value : {
|
|
type : string
|
|
value : abc
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: Object(Symbol(42))
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Symbol
|
|
description : Symbol
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[PrimitiveValue]]
|
|
value : {
|
|
description : Symbol(42)
|
|
objectId : <objectId>
|
|
type : symbol
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: Object(BigInt(2))
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : BigInt
|
|
description : BigInt
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[PrimitiveValue]]
|
|
value : {
|
|
description : 2n
|
|
type : bigint
|
|
unserializableValue : 2n
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
Running test: promise
|
|
expression: Promise.resolve(42)
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Promise
|
|
description : Promise
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[PromiseState]]
|
|
value : {
|
|
type : string
|
|
value : fulfilled
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[PromiseResult]]
|
|
value : {
|
|
description : 42
|
|
type : number
|
|
value : 42
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: new Promise(() => undefined)
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Promise
|
|
description : Promise
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[PromiseState]]
|
|
value : {
|
|
type : string
|
|
value : pending
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[PromiseResult]]
|
|
value : {
|
|
type : undefined
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
Running test: generatorObject
|
|
expression: gen1
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[GeneratorLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 13
|
|
lineNumber : 8
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Generator
|
|
description : Generator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[GeneratorState]]
|
|
value : {
|
|
type : string
|
|
value : suspended
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[GeneratorFunction]]
|
|
value : {
|
|
className : GeneratorFunction
|
|
description : function* foo() { yield 1; }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[GeneratorReceiver]]
|
|
value : {
|
|
className : global
|
|
description : global
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[5] : {
|
|
name : [[Scopes]]
|
|
value : {
|
|
className : Array
|
|
description : Scopes[2]
|
|
objectId : <objectId>
|
|
subtype : internal#scopeList
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: gen1.next();gen1
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[GeneratorLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 2
|
|
lineNumber : 9
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Generator
|
|
description : Generator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[GeneratorState]]
|
|
value : {
|
|
type : string
|
|
value : suspended
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[GeneratorFunction]]
|
|
value : {
|
|
className : GeneratorFunction
|
|
description : function* foo() { yield 1; }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[GeneratorReceiver]]
|
|
value : {
|
|
className : global
|
|
description : global
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[5] : {
|
|
name : [[Scopes]]
|
|
value : {
|
|
className : Array
|
|
description : Scopes[2]
|
|
objectId : <objectId>
|
|
subtype : internal#scopeList
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: gen1.next();gen1
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[GeneratorLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 13
|
|
lineNumber : 8
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Generator
|
|
description : Generator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[GeneratorState]]
|
|
value : {
|
|
type : string
|
|
value : closed
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[GeneratorFunction]]
|
|
value : {
|
|
className : GeneratorFunction
|
|
description : function* foo() { yield 1; }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[GeneratorReceiver]]
|
|
value : {
|
|
className : global
|
|
description : global
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
Running test: generatorObjectDebuggerDisabled
|
|
expression: gen2
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[GeneratorLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 13
|
|
lineNumber : 8
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Generator
|
|
description : Generator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[GeneratorState]]
|
|
value : {
|
|
type : string
|
|
value : suspended
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[GeneratorFunction]]
|
|
value : {
|
|
className : GeneratorFunction
|
|
description : function* foo() { yield 1; }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[GeneratorReceiver]]
|
|
value : {
|
|
className : global
|
|
description : global
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[5] : {
|
|
name : [[Scopes]]
|
|
value : {
|
|
className : Array
|
|
description : Scopes[2]
|
|
objectId : <objectId>
|
|
subtype : internal#scopeList
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: gen2.next();gen2
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[GeneratorLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 2
|
|
lineNumber : 9
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Generator
|
|
description : Generator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[GeneratorState]]
|
|
value : {
|
|
type : string
|
|
value : suspended
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[GeneratorFunction]]
|
|
value : {
|
|
className : GeneratorFunction
|
|
description : function* foo() { yield 1; }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[GeneratorReceiver]]
|
|
value : {
|
|
className : global
|
|
description : global
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[5] : {
|
|
name : [[Scopes]]
|
|
value : {
|
|
className : Array
|
|
description : Scopes[2]
|
|
objectId : <objectId>
|
|
subtype : internal#scopeList
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: gen2.next();gen2
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[GeneratorLocation]]
|
|
value : {
|
|
description : Object
|
|
subtype : internal#location
|
|
type : object
|
|
value : {
|
|
columnNumber : 13
|
|
lineNumber : 8
|
|
scriptId : <scriptId>
|
|
}
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Generator
|
|
description : Generator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[GeneratorState]]
|
|
value : {
|
|
type : string
|
|
value : closed
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[GeneratorFunction]]
|
|
value : {
|
|
className : GeneratorFunction
|
|
description : function* foo() { yield 1; }
|
|
objectId : <objectId>
|
|
type : function
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[GeneratorReceiver]]
|
|
value : {
|
|
className : global
|
|
description : global
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
Running test: iteratorObject
|
|
expression: (new Map([[1,2]])).entries()
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Map Iterator
|
|
description : Map Iterator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[IteratorHasMore]]
|
|
value : {
|
|
type : boolean
|
|
value : true
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[IteratorIndex]]
|
|
value : {
|
|
description : 0
|
|
type : number
|
|
value : 0
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[IteratorKind]]
|
|
value : {
|
|
type : string
|
|
value : entries
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[Entries]]
|
|
value : {
|
|
className : Array
|
|
description : Array(1)
|
|
objectId : <objectId>
|
|
subtype : array
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
expression: (new Set([[1,2]])).entries()
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
internalProperties : [
|
|
[0] : {
|
|
name : [[Prototype]]
|
|
value : {
|
|
className : Set Iterator
|
|
description : Set Iterator
|
|
objectId : <objectId>
|
|
type : object
|
|
}
|
|
}
|
|
[1] : {
|
|
name : [[IteratorHasMore]]
|
|
value : {
|
|
type : boolean
|
|
value : true
|
|
}
|
|
}
|
|
[2] : {
|
|
name : [[IteratorIndex]]
|
|
value : {
|
|
description : 0
|
|
type : number
|
|
value : 0
|
|
}
|
|
}
|
|
[3] : {
|
|
name : [[IteratorKind]]
|
|
value : {
|
|
type : string
|
|
value : entries
|
|
}
|
|
}
|
|
[4] : {
|
|
name : [[Entries]]
|
|
value : {
|
|
className : Array
|
|
description : Array(1)
|
|
objectId : <objectId>
|
|
subtype : array
|
|
type : object
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|