Commit 4401ac44 authored by Dmitry Gozman's avatar Dmitry Gozman

Revert "inspector: return [[StableObjectId]] as internal property"

This reverts commit d9fbfeb8.

Reason for revert: see bug.
Bug: 906847

Original change's description:
> inspector: return [[StableObjectId]] as internal property
> 
> This property might be useful for fast '===' check.
> 
> R=​dgozman@chromium.org,yangguo@chromium.org
> 
> Bug: none
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: Iabc3555ce1ec2c14cf0ccd40b7d964ae144e7352
> Reviewed-on: https://chromium-review.googlesource.com/1226411
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56095}

TBR=dgozman@chromium.org,yangguo@chromium.org,kozyatinskiy@chromium.org,jgruber@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: none
Change-Id: I68c700b7b8fd0a015f099460c15665d74e4da183
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/c/1363558Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58077}
parent 8ed4e172
...@@ -702,37 +702,11 @@ v8::MaybeLocal<v8::Array> V8Debugger::collectionsEntries( ...@@ -702,37 +702,11 @@ v8::MaybeLocal<v8::Array> V8Debugger::collectionsEntries(
return wrappedEntries; return wrappedEntries;
} }
v8::MaybeLocal<v8::Uint32> V8Debugger::stableObjectId(
v8::Local<v8::Context> context, v8::Local<v8::Value> value) {
DCHECK(value->IsObject());
if (m_stableObjectId.IsEmpty()) {
m_stableObjectId.Reset(m_isolate, v8::debug::WeakMap::New(m_isolate));
}
v8::Local<v8::debug::WeakMap> stableObjectId =
m_stableObjectId.Get(m_isolate);
v8::Local<v8::Value> idValue;
if (!stableObjectId->Get(context, value).ToLocal(&idValue) ||
!idValue->IsUint32()) {
idValue = v8::Integer::NewFromUnsigned(m_isolate, ++m_lastStableObjectId);
stableObjectId->Set(context, value, idValue).ToLocalChecked();
}
return idValue.As<v8::Uint32>();
}
v8::MaybeLocal<v8::Array> V8Debugger::internalProperties( v8::MaybeLocal<v8::Array> V8Debugger::internalProperties(
v8::Local<v8::Context> context, v8::Local<v8::Value> value) { v8::Local<v8::Context> context, v8::Local<v8::Value> value) {
v8::Local<v8::Array> properties; v8::Local<v8::Array> properties;
if (!v8::debug::GetInternalProperties(m_isolate, value).ToLocal(&properties)) if (!v8::debug::GetInternalProperties(m_isolate, value).ToLocal(&properties))
return v8::MaybeLocal<v8::Array>(); return v8::MaybeLocal<v8::Array>();
if (value->IsObject()) {
v8::Local<v8::Uint32> id;
if (stableObjectId(context, value).ToLocal(&id)) {
createDataProperty(
context, properties, properties->Length(),
toV8StringInternalized(m_isolate, "[[StableObjectId]]"));
createDataProperty(context, properties, properties->Length(), id);
}
}
v8::Local<v8::Array> entries; v8::Local<v8::Array> entries;
if (collectionsEntries(context, value).ToLocal(&entries)) { if (collectionsEntries(context, value).ToLocal(&entries)) {
createDataProperty(context, properties, properties->Length(), createDataProperty(context, properties, properties->Length(),
......
...@@ -198,9 +198,6 @@ class V8Debugger : public v8::debug::DebugDelegate, ...@@ -198,9 +198,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
int currentContextGroupId(); int currentContextGroupId();
bool asyncStepOutOfFunction(int targetContextGroupId, bool onlyAtReturn); bool asyncStepOutOfFunction(int targetContextGroupId, bool onlyAtReturn);
v8::MaybeLocal<v8::Uint32> stableObjectId(v8::Local<v8::Context>,
v8::Local<v8::Value>);
v8::Isolate* m_isolate; v8::Isolate* m_isolate;
V8InspectorImpl* m_inspector; V8InspectorImpl* m_inspector;
int m_enableCount; int m_enableCount;
...@@ -257,9 +254,6 @@ class V8Debugger : public v8::debug::DebugDelegate, ...@@ -257,9 +254,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
std::unique_ptr<TerminateExecutionCallback> m_terminateExecutionCallback; std::unique_ptr<TerminateExecutionCallback> m_terminateExecutionCallback;
uint32_t m_lastStableObjectId = 0;
v8::Global<v8::debug::WeakMap> m_stableObjectId;
v8::Global<v8::debug::WeakMap> m_internalObjects; v8::Global<v8::debug::WeakMap> m_internalObjects;
WasmTranslation m_wasmTranslation; WasmTranslation m_wasmTranslation;
......
...@@ -2,12 +2,6 @@ Tests that variables introduced in eval scopes are accessible ...@@ -2,12 +2,6 @@ Tests that variables introduced in eval scopes are accessible
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
......
...@@ -2,12 +2,6 @@ Tests that scopes do not report variables with empty names ...@@ -2,12 +2,6 @@ Tests that scopes do not report variables with empty names
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
......
...@@ -128,12 +128,6 @@ console.log(239) ...@@ -128,12 +128,6 @@ console.log(239)
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
......
...@@ -5,7 +5,6 @@ Running test: testObject5 ...@@ -5,7 +5,6 @@ Running test: testObject5
foo own string cat foo own string cat
Internal properties Internal properties
[[PrimitiveValue]] number 5 [[PrimitiveValue]] number 5
[[StableObjectId]]: <stableObjectId>
Running test: testNotOwn Running test: testNotOwn
__defineGetter__ inherited function undefined __defineGetter__ inherited function undefined
...@@ -24,8 +23,6 @@ Running test: testNotOwn ...@@ -24,8 +23,6 @@ Running test: testNotOwn
toLocaleString inherited function undefined toLocaleString inherited function undefined
toString inherited function undefined toString inherited function undefined
valueOf inherited function undefined valueOf inherited function undefined
Internal properties
[[StableObjectId]]: <stableObjectId>
Running test: testAccessorsOnly Running test: testAccessorsOnly
b own no value, getter, setter b own no value, getter, setter
...@@ -37,8 +34,6 @@ Running test: testArray ...@@ -37,8 +34,6 @@ Running test: testArray
2 own string blue 2 own string blue
__proto__ own object undefined __proto__ own object undefined
length own number 3 length own number 3
Internal properties
[[StableObjectId]]: <stableObjectId>
Running test: testBound Running test: testBound
__proto__ own function undefined __proto__ own function undefined
...@@ -47,19 +42,14 @@ Running test: testBound ...@@ -47,19 +42,14 @@ Running test: testBound
Internal properties Internal properties
[[BoundArgs]] object undefined [[BoundArgs]] object undefined
[[BoundThis]] object undefined [[BoundThis]] object undefined
[[StableObjectId]]: <stableObjectId>
[[TargetFunction]] function undefined [[TargetFunction]] function undefined
Running test: testObjectThrowsLength Running test: testObjectThrowsLength
__proto__ own object undefined __proto__ own object undefined
length own no value, getter length own no value, getter
Internal properties
[[StableObjectId]]: <stableObjectId>
Running test: testTypedArrayWithoutLength Running test: testTypedArrayWithoutLength
__proto__ own object undefined __proto__ own object undefined
Internal properties
[[StableObjectId]]: <stableObjectId>
Running test: testArrayBuffer Running test: testArrayBuffer
[[Int8Array]] [[Int8Array]]
...@@ -72,8 +62,6 @@ Running test: testArrayBuffer ...@@ -72,8 +62,6 @@ Running test: testArrayBuffer
6 own number 1 6 own number 1
7 own number 1 7 own number 1
__proto__ own object undefined __proto__ own object undefined
Internal properties
[[StableObjectId]]: <stableObjectId>
[[Uint8Array]] [[Uint8Array]]
0 own number 1 0 own number 1
1 own number 1 1 own number 1
...@@ -84,26 +72,18 @@ Internal properties ...@@ -84,26 +72,18 @@ Internal properties
6 own number 1 6 own number 1
7 own number 1 7 own number 1
__proto__ own object undefined __proto__ own object undefined
Internal properties
[[StableObjectId]]: <stableObjectId>
[[Int16Array]] [[Int16Array]]
0 own number 257 0 own number 257
1 own number 257 1 own number 257
2 own number 257 2 own number 257
3 own number 257 3 own number 257
__proto__ own object undefined __proto__ own object undefined
Internal properties
[[StableObjectId]]: <stableObjectId>
[[Int32Array]] [[Int32Array]]
0 own number 16843009 0 own number 16843009
1 own number 16843009 1 own number 16843009
__proto__ own object undefined __proto__ own object undefined
Internal properties
[[StableObjectId]]: <stableObjectId>
Running test: testArrayBufferWithBrokenUintCtor Running test: testArrayBufferWithBrokenUintCtor
[[Int8Array]] own object undefined [[Int8Array]] own object undefined
[[Uint8Array]] own object undefined [[Uint8Array]] own object undefined
__proto__ own object undefined __proto__ own object undefined
Internal properties
[[StableObjectId]]: <stableObjectId>
...@@ -54,10 +54,6 @@ Testing regular Proxy ...@@ -54,10 +54,6 @@ Testing regular Proxy
value : false value : false
} }
} }
[3] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
result : [ result : [
] ]
...@@ -118,10 +114,6 @@ Testing revocable Proxy ...@@ -118,10 +114,6 @@ Testing revocable Proxy
value : false value : false
} }
} }
[3] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
result : [ result : [
] ]
...@@ -174,10 +166,6 @@ Testing revocable Proxy ...@@ -174,10 +166,6 @@ Testing revocable Proxy
value : true value : true
} }
} }
[3] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
result : [ result : [
] ]
......
...@@ -94,10 +94,7 @@ async function logGetPropertiesResult(objectId, flags = { ownProperties: true }) ...@@ -94,10 +94,7 @@ async function logGetPropertiesResult(objectId, flags = { ownProperties: true })
for (var i = 0; i < internalPropertyArray.length; i++) { for (var i = 0; i < internalPropertyArray.length; i++) {
var p = internalPropertyArray[i]; var p = internalPropertyArray[i];
var v = p.value; var v = p.value;
if (p.name !== '[[StableObjectId]]') InspectorTest.log(' ' + p.name + ' ' + v.type + ' ' + v.value);
InspectorTest.log(" " + p.name + " " + v.type + " " + v.value);
else
InspectorTest.log(" [[StableObjectId]]: <stableObjectId>");
} }
} }
......
...@@ -15,12 +15,6 @@ expression: new Map([[1,2],[3,4]]) ...@@ -15,12 +15,6 @@ expression: new Map([[1,2],[3,4]])
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -71,12 +65,6 @@ expression: new Map() ...@@ -71,12 +65,6 @@ expression: new Map()
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
...@@ -109,12 +97,6 @@ expression: new Map([[1,2],[3,4]]).entries() ...@@ -109,12 +97,6 @@ expression: new Map([[1,2],[3,4]]).entries()
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -169,12 +151,6 @@ expression: it = new Map([[1,2],[3,4]]).entries(); it.next(); it ...@@ -169,12 +151,6 @@ expression: it = new Map([[1,2],[3,4]]).entries(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -214,12 +190,6 @@ expression: it = new Map([[1,2],[3,4]]).keys(); it.next(); it ...@@ -214,12 +190,6 @@ expression: it = new Map([[1,2],[3,4]]).keys(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -259,12 +229,6 @@ expression: it = new Map([[1,2],[3,4]]).values(); it.next(); it ...@@ -259,12 +229,6 @@ expression: it = new Map([[1,2],[3,4]]).values(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -301,12 +265,6 @@ expression: it = new Map([[1,2],[3,4]]).entries(); it.next(); it.next(); it ...@@ -301,12 +265,6 @@ expression: it = new Map([[1,2],[3,4]]).entries(); it.next(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
...@@ -347,12 +305,6 @@ expression: new Map([[1, undefined], [2, () => 42], [3, /abc/], [4, new Error()] ...@@ -347,12 +305,6 @@ expression: new Map([[1, undefined], [2, () => 42], [3, /abc/], [4, new Error()]
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -439,12 +391,6 @@ expression: new Set([1,2]) ...@@ -439,12 +391,6 @@ expression: new Set([1,2])
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -495,12 +441,6 @@ expression: new Set() ...@@ -495,12 +441,6 @@ expression: new Set()
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
...@@ -531,12 +471,6 @@ expression: new Set([1,2]).values() ...@@ -531,12 +471,6 @@ expression: new Set([1,2]).values()
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -590,12 +524,6 @@ expression: it = new Set([1,2]).values(); it.next(); it ...@@ -590,12 +524,6 @@ expression: it = new Set([1,2]).values(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -635,12 +563,6 @@ expression: it = new Set([1,2]).keys(); it.next(); it ...@@ -635,12 +563,6 @@ expression: it = new Set([1,2]).keys(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -680,12 +602,6 @@ expression: it = new Set([1,2]).entries(); it.next(); it ...@@ -680,12 +602,6 @@ expression: it = new Set([1,2]).entries(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -722,12 +638,6 @@ expression: it = new Set([1,2]).values(); it.next(); it.next(); it ...@@ -722,12 +638,6 @@ expression: it = new Set([1,2]).values(); it.next(); it.next(); it
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
...@@ -752,12 +662,6 @@ expression: new WeakMap() ...@@ -752,12 +662,6 @@ expression: new WeakMap()
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
...@@ -786,12 +690,6 @@ expression: new WeakMap([[{ a: 2 }, 42]]) ...@@ -786,12 +690,6 @@ expression: new WeakMap([[{ a: 2 }, 42]])
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -830,12 +728,6 @@ expression: new WeakSet() ...@@ -830,12 +728,6 @@ expression: new WeakSet()
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
...@@ -863,12 +755,6 @@ expression: new WeakSet([{a:2}]) ...@@ -863,12 +755,6 @@ expression: new WeakSet([{a:2}])
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
......
...@@ -27,10 +27,6 @@ expression: (function* foo() { yield 1 }) ...@@ -27,10 +27,6 @@ expression: (function* foo() { yield 1 })
} }
} }
[2] : { [2] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[3] : {
name : [[Scopes]] name : [[Scopes]]
value : { value : {
className : Array className : Array
...@@ -64,10 +60,6 @@ expression: (function foo() {}) ...@@ -64,10 +60,6 @@ expression: (function foo() {})
} }
} }
[1] : { [1] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[2] : {
name : [[Scopes]] name : [[Scopes]]
value : { value : {
className : Array className : Array
...@@ -95,10 +87,6 @@ expression: new Number(239) ...@@ -95,10 +87,6 @@ expression: new Number(239)
value : 239 value : 239
} }
} }
[1] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -114,10 +102,6 @@ expression: new Boolean(false) ...@@ -114,10 +102,6 @@ expression: new Boolean(false)
value : false value : false
} }
} }
[1] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -133,10 +117,6 @@ expression: new String('abc') ...@@ -133,10 +117,6 @@ expression: new String('abc')
value : abc value : abc
} }
} }
[1] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -153,10 +133,6 @@ expression: Object(Symbol(42)) ...@@ -153,10 +133,6 @@ expression: Object(Symbol(42))
type : symbol type : symbol
} }
} }
[1] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -173,10 +149,6 @@ expression: Object(BigInt(2)) ...@@ -173,10 +149,6 @@ expression: Object(BigInt(2))
unserializableValue : 2n unserializableValue : 2n
} }
} }
[1] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -202,10 +174,6 @@ expression: Promise.resolve(42) ...@@ -202,10 +174,6 @@ expression: Promise.resolve(42)
value : 42 value : 42
} }
} }
[2] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -227,10 +195,6 @@ expression: new Promise(() => undefined) ...@@ -227,10 +195,6 @@ expression: new Promise(() => undefined)
type : undefined type : undefined
} }
} }
[2] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -280,10 +244,6 @@ expression: gen1 ...@@ -280,10 +244,6 @@ expression: gen1
} }
} }
[4] : { [4] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[5] : {
name : [[Scopes]] name : [[Scopes]]
value : { value : {
className : Array className : Array
...@@ -340,10 +300,6 @@ expression: gen1.next();gen1 ...@@ -340,10 +300,6 @@ expression: gen1.next();gen1
} }
} }
[4] : { [4] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[5] : {
name : [[Scopes]] name : [[Scopes]]
value : { value : {
className : Array className : Array
...@@ -399,10 +355,6 @@ expression: gen1.next();gen1 ...@@ -399,10 +355,6 @@ expression: gen1.next();gen1
type : object type : object
} }
} }
[4] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -452,10 +404,6 @@ expression: gen2 ...@@ -452,10 +404,6 @@ expression: gen2
} }
} }
[4] : { [4] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[5] : {
name : [[Scopes]] name : [[Scopes]]
value : { value : {
className : Array className : Array
...@@ -512,10 +460,6 @@ expression: gen2.next();gen2 ...@@ -512,10 +460,6 @@ expression: gen2.next();gen2
} }
} }
[4] : { [4] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[5] : {
name : [[Scopes]] name : [[Scopes]]
value : { value : {
className : Array className : Array
...@@ -571,10 +515,6 @@ expression: gen2.next();gen2 ...@@ -571,10 +515,6 @@ expression: gen2.next();gen2
type : object type : object
} }
} }
[4] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
] ]
} }
} }
...@@ -608,10 +548,6 @@ expression: (new Map([[1,2]])).entries() ...@@ -608,10 +548,6 @@ expression: (new Map([[1,2]])).entries()
} }
} }
[3] : { [3] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[4] : {
name : [[Entries]] name : [[Entries]]
value : { value : {
className : Array className : Array
...@@ -652,10 +588,6 @@ expression: (new Set([[1,2]])).entries() ...@@ -652,10 +588,6 @@ expression: (new Set([[1,2]])).entries()
} }
} }
[3] : { [3] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
[4] : {
name : [[Entries]] name : [[Entries]]
value : { value : {
className : Array className : Array
......
...@@ -4,12 +4,6 @@ Running test: testObject ...@@ -4,12 +4,6 @@ Running test: testObject
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -42,12 +36,6 @@ Running test: testObject ...@@ -42,12 +36,6 @@ Running test: testObject
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
......
Checks that protocol returns the same RemoteObjectId for the same object
Running test: testGlobal
Compare global evaluated twice: true
Running test: testObject
Compare object evaluated twice: true
Running test: testObjectInArray
Compare first and second element: true
Running test: testObjectOnPause
Compare global and this: true
Compare global and global on pause: true
Compare a and a on pause: true
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} = InspectorTest.start(
'Checks that protocol returns the same RemoteObjectId for the same object');
InspectorTest.runAsyncTestSuite([
async function testGlobal() {
const {result:{result:{objectId:firstId}}} =
await Protocol.Runtime.evaluate({expression: 'this'});
const firstStableId = await stableObjectId(firstId);
const {result:{result:{objectId:secondId}}} =
await Protocol.Runtime.evaluate({expression: 'this'});
const secondStableId = await stableObjectId(secondId);
InspectorTest.log(
`Compare global evaluated twice: ${firstStableId === secondStableId}`);
},
async function testObject() {
const {result:{result:{objectId:firstId}}} =
await Protocol.Runtime.evaluate({expression: 'this.a = {}, this.a'});
const firstStableId = await stableObjectId(firstId);
const {result:{result:{objectId:secondId}}} =
await Protocol.Runtime.evaluate({expression: 'this.a'});
const secondStableId = await stableObjectId(secondId);
InspectorTest.log(
`Compare object evaluated twice: ${firstStableId === secondStableId}`);
},
async function testObjectInArray() {
await Protocol.Runtime.evaluate({expression: 'this.b = [this.a, this.a]'});
const {result:{result:{objectId:firstId}}} =
await Protocol.Runtime.evaluate({expression: 'this.b[0]'});
const firstStableId = await stableObjectId(firstId);
const {result:{result:{objectId:secondId}}} =
await Protocol.Runtime.evaluate({expression: 'this.b[1]'});
const secondStableId = await stableObjectId(secondId);
InspectorTest.log(
`Compare first and second element: ${firstStableId === secondStableId}`);
},
async function testObjectOnPause() {
const {result:{result:{objectId:globalId}}} =
await Protocol.Runtime.evaluate({expression: 'this'});
const globalStableId = await stableObjectId(globalId);
const {result:{result:{objectId:aId}}} =
await Protocol.Runtime.evaluate({expression: 'this.a'});
const aStableId = await stableObjectId(aId);
await Protocol.Debugger.enable();
Protocol.Runtime.evaluate({expression: 'debugger'});
const {params:{callFrames:[topFrame]}} =
await Protocol.Debugger.oncePaused();
const topFrameThisStableId = await stableObjectId(topFrame.this.objectId);
InspectorTest.log(
`Compare global and this: ${globalStableId === topFrameThisStableId}`);
const {result:{result:{objectId:globalIdOnPause}}} =
await Protocol.Debugger.evaluateOnCallFrame({
callFrameId: topFrame.callFrameId,
expression: 'this'
});
const globalStableIdOnPause = await stableObjectId(globalIdOnPause);
InspectorTest.log(
`Compare global and global on pause: ${
globalStableId === globalStableIdOnPause}`);
const {result:{result: props}} = await Protocol.Runtime.getProperties({
objectId: topFrame.scopeChain[0].object.objectId
});
const {value:{objectId: aIdOnPause}} = props.find(prop => prop.name === 'a');
const aStableIdOnPause = await stableObjectId(aIdOnPause);
InspectorTest.log(`Compare a and a on pause: ${
aStableId === aStableIdOnPause}`);
}
]);
async function stableObjectId(objectId) {
const {result:{
internalProperties: props
}} = await Protocol.Runtime.getProperties({
objectId,
ownProperties: true,
generatePreview: false
});
return props.find(prop => prop.name === '[[StableObjectId]]').value.value;
}
...@@ -5,12 +5,6 @@ Retrieving properties in 2 ...@@ -5,12 +5,6 @@ Retrieving properties in 2
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -44,12 +38,6 @@ Retrieving properties in 1 ...@@ -44,12 +38,6 @@ Retrieving properties in 1
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -84,12 +72,6 @@ Retrieving properties in 1 ...@@ -84,12 +72,6 @@ Retrieving properties in 1
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[StableObjectId]]
value : <StablectObjectId>
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment