Commit b1f5eeab authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

Reland "[inspector] Report [[Prototype]] as internal property."

This is a reland of 2b94e567

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: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73899}
parent 8284359e
...@@ -1050,78 +1050,57 @@ std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame) { ...@@ -1050,78 +1050,57 @@ std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame) {
return std::make_unique<DebugWasmScopeIterator>(frame); return std::make_unique<DebugWasmScopeIterator>(frame);
} }
Handle<JSArray> GetWasmInstanceObjectInternalProperties( Handle<ArrayList> AddWasmInstanceObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmInstanceObject> instance) { Handle<WasmInstanceObject> instance) {
Isolate* isolate = instance->GetIsolate(); result = ArrayList::Add(
Handle<FixedArray> result = isolate->factory()->NewFixedArray(2 * 5); isolate, result,
int length = 0; isolate->factory()->NewStringFromAsciiChecked("[[Module]]"),
handle(instance->module_object(), isolate));
Handle<String> module_str =
isolate->factory()->NewStringFromAsciiChecked("[[Module]]");
Handle<Object> module_obj = handle(instance->module_object(), isolate);
result->set(length++, *module_str);
result->set(length++, *module_obj);
if (FunctionsProxy::Count(isolate, instance) != 0) { if (FunctionsProxy::Count(isolate, instance) != 0) {
Handle<String> functions_str = result = ArrayList::Add(
isolate->factory()->NewStringFromAsciiChecked("[[Functions]]"); isolate, result,
Handle<Object> functions_obj = isolate->factory()->NewStringFromAsciiChecked("[[Functions]]"),
GetOrCreateInstanceProxy<FunctionsProxy>(isolate, instance); GetOrCreateInstanceProxy<FunctionsProxy>(isolate, instance));
result->set(length++, *functions_str);
result->set(length++, *functions_obj);
} }
if (GlobalsProxy::Count(isolate, instance) != 0) { if (GlobalsProxy::Count(isolate, instance) != 0) {
Handle<String> globals_str = result = ArrayList::Add(
isolate->factory()->NewStringFromAsciiChecked("[[Globals]]"); isolate, result,
Handle<Object> globals_obj = isolate->factory()->NewStringFromAsciiChecked("[[Globals]]"),
GetOrCreateInstanceProxy<GlobalsProxy>(isolate, instance); GetOrCreateInstanceProxy<GlobalsProxy>(isolate, instance));
result->set(length++, *globals_str);
result->set(length++, *globals_obj);
} }
if (MemoriesProxy::Count(isolate, instance) != 0) { if (MemoriesProxy::Count(isolate, instance) != 0) {
Handle<String> memories_str = result = ArrayList::Add(
isolate->factory()->NewStringFromAsciiChecked("[[Memories]]"); isolate, result,
Handle<Object> memories_obj = isolate->factory()->NewStringFromAsciiChecked("[[Memories]]"),
GetOrCreateInstanceProxy<MemoriesProxy>(isolate, instance); GetOrCreateInstanceProxy<MemoriesProxy>(isolate, instance));
result->set(length++, *memories_str);
result->set(length++, *memories_obj);
} }
if (TablesProxy::Count(isolate, instance) != 0) { if (TablesProxy::Count(isolate, instance) != 0) {
Handle<String> tables_str = result = ArrayList::Add(
isolate->factory()->NewStringFromAsciiChecked("[[Tables]]"); isolate, result,
Handle<Object> tables_obj = isolate->factory()->NewStringFromAsciiChecked("[[Tables]]"),
GetOrCreateInstanceProxy<TablesProxy>(isolate, instance); GetOrCreateInstanceProxy<TablesProxy>(isolate, instance));
result->set(length++, *tables_str);
result->set(length++, *tables_obj);
} }
return isolate->factory()->NewJSArrayWithElements(result, PACKED_ELEMENTS, return result;
length);
} }
Handle<JSArray> GetWasmModuleObjectInternalProperties( Handle<ArrayList> AddWasmModuleObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmModuleObject> module_object) { Handle<WasmModuleObject> module_object) {
Isolate* isolate = module_object->GetIsolate(); result = ArrayList::Add(
Handle<FixedArray> result = isolate->factory()->NewFixedArray(2 * 2); isolate, result,
int length = 0; isolate->factory()->NewStringFromStaticChars("[[Exports]]"),
wasm::GetExports(isolate, module_object));
Handle<String> exports_str = result = ArrayList::Add(
isolate->factory()->NewStringFromStaticChars("[[Exports]]"); isolate, result,
Handle<JSArray> exports_obj = wasm::GetExports(isolate, module_object); isolate->factory()->NewStringFromStaticChars("[[Imports]]"),
result->set(length++, *exports_str); wasm::GetImports(isolate, module_object));
result->set(length++, *exports_obj); return result;
Handle<String> imports_str =
isolate->factory()->NewStringFromStaticChars("[[Imports]]");
Handle<JSArray> imports_obj = wasm::GetImports(isolate, module_object);
result->set(length++, *imports_str);
result->set(length++, *imports_obj);
return isolate->factory()->NewJSArrayWithElements(result, PACKED_ELEMENTS,
length);
} }
} // namespace internal } // namespace internal
......
...@@ -28,6 +28,7 @@ class WasmValue; ...@@ -28,6 +28,7 @@ class WasmValue;
#include "torque-generated/src/debug/debug-wasm-objects-tq.inc" #include "torque-generated/src/debug/debug-wasm-objects-tq.inc"
class ArrayList;
class WasmFrame; class WasmFrame;
class WasmInstanceObject; class WasmInstanceObject;
class WasmModuleObject; class WasmModuleObject;
...@@ -68,9 +69,11 @@ Handle<JSObject> GetWasmDebugProxy(WasmFrame* frame); ...@@ -68,9 +69,11 @@ Handle<JSObject> GetWasmDebugProxy(WasmFrame* frame);
std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame); std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame);
Handle<JSArray> GetWasmInstanceObjectInternalProperties( Handle<ArrayList> AddWasmInstanceObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmInstanceObject> instance); Handle<WasmInstanceObject> instance);
Handle<JSArray> GetWasmModuleObjectInternalProperties( Handle<ArrayList> AddWasmModuleObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmModuleObject> module_object); Handle<WasmModuleObject> module_object);
} // namespace internal } // namespace internal
......
...@@ -1216,7 +1216,6 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context, ...@@ -1216,7 +1216,6 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
return false; return false;
} }
} }
bool shouldSkipProto = internalType == V8InternalValueType::kScopeList;
bool formatAccessorsAsProperties = bool formatAccessorsAsProperties =
clientFor(context)->formatAccessorsAsProperties(object); clientFor(context)->formatAccessorsAsProperties(object);
...@@ -1304,8 +1303,7 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context, ...@@ -1304,8 +1303,7 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
bool isSymbolDescription = bool isSymbolDescription =
object->IsSymbol() && name == "description"; object->IsSymbol() && name == "description";
if (isSymbolDescription || if (isSymbolDescription ||
(name != "__proto__" && getterIsNativeFunction && (getterIsNativeFunction && formatAccessorsAsProperties &&
formatAccessorsAsProperties &&
!doesAttributeHaveObservableSideEffectOnGet(context, object, !doesAttributeHaveObservableSideEffectOnGet(context, object,
v8Name))) { v8Name))) {
v8::TryCatch tryCatch(isolate); v8::TryCatch tryCatch(isolate);
...@@ -1321,7 +1319,6 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context, ...@@ -1321,7 +1319,6 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
} }
} }
if (accessorPropertiesOnly && !isAccessorProperty) continue; if (accessorPropertiesOnly && !isAccessorProperty) continue;
if (name == "__proto__") shouldSkipProto = true;
auto mirror = PropertyMirror{name, auto mirror = PropertyMirror{name,
writable, writable,
configurable, configurable,
...@@ -1340,16 +1337,6 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context, ...@@ -1340,16 +1337,6 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
return false; return false;
} }
} }
if (!shouldSkipProto && ownProperties && !object->IsProxy() &&
!accessorPropertiesOnly) {
v8::Local<v8::Value> prototype = object->GetPrototype();
if (prototype->IsObject()) {
accumulator->Add(PropertyMirror{String16("__proto__"), true, true, false,
true, false,
ValueMirror::create(context, prototype),
nullptr, nullptr, nullptr, nullptr});
}
}
return true; return true;
} }
......
This diff is collapsed.
...@@ -463,7 +463,12 @@ class DebugWrapper { ...@@ -463,7 +463,12 @@ class DebugWrapper {
"Runtime.getProperties", { objectId : objectId, ownProperties: true }); "Runtime.getProperties", { objectId : objectId, ownProperties: true });
this.sendMessage(msg); this.sendMessage(msg);
const reply = this.takeReplyChecked(msgid); const reply = this.takeReplyChecked(msgid);
return Object(reply.result.internalProperties[0].value.value); for (const internalProperty of reply.result.internalProperties) {
if (internalProperty.name === '[[PrimitiveValue]]') {
return Object(internalProperty.value.value);
}
}
throw new Error('Remote object is not a value wrapper');
} }
reconstructRemoteObject(obj) { reconstructRemoteObject(obj) {
......
Checks Runtime.getProperties method while debugger is paused. Checks Runtime.getProperties method while debugger is paused.
Running test: testObject5 Running test: testObject5
__proto__ own object undefined
foo own string cat foo own string cat
Internal properties Internal properties
[[PrimitiveValue]] number 5 [[PrimitiveValue]] number 5
[[Prototype]] object undefined
Running test: testNotOwn Running test: testNotOwn
__defineGetter__ inherited function undefined __defineGetter__ inherited function undefined
...@@ -23,6 +23,8 @@ Running test: testNotOwn ...@@ -23,6 +23,8 @@ 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
[[Prototype]] object undefined
Running test: testAccessorsOnly Running test: testAccessorsOnly
b own no value, getter, setter b own no value, getter, setter
...@@ -32,31 +34,34 @@ Running test: testArray ...@@ -32,31 +34,34 @@ Running test: testArray
0 own string red 0 own string red
1 own string green 1 own string green
2 own string blue 2 own string blue
__proto__ own object undefined
length own number 3 length own number 3
Internal properties
[[Prototype]] object undefined
Running test: testBound Running test: testBound
__proto__ own function undefined
length own number 0 length own number 0
name own string bound Number name own string bound Number
Internal properties Internal properties
[[BoundArgs]] object undefined [[BoundArgs]] object undefined
[[BoundThis]] object undefined [[BoundThis]] object undefined
[[Prototype]] function undefined
[[TargetFunction]] function undefined [[TargetFunction]] function undefined
Running test: testObjectThrowsLength Running test: testObjectThrowsLength
__proto__ own object undefined
length own no value, getter length own no value, getter
Internal properties
[[Prototype]] object undefined
Running test: testTypedArrayWithoutLength Running test: testTypedArrayWithoutLength
__proto__ own object undefined Internal properties
[[Prototype]] object undefined
Running test: testArrayBuffer Running test: testArrayBuffer
Running test: testArrayBufferWithBrokenUintCtor Running test: testArrayBufferWithBrokenUintCtor
__proto__ own object undefined
Internal properties Internal properties
[[ArrayBufferByteLength]] number 7 [[ArrayBufferByteLength]] number 7
[[ArrayBufferData]] string 0x... [[ArrayBufferData]] string 0x...
[[Int8Array]] object undefined [[Int8Array]] object undefined
[[Prototype]] object undefined
[[Uint8Array]] object undefined [[Uint8Array]] object undefined
...@@ -42,8 +42,6 @@ let { Protocol } = InspectorTest.start('Checks Runtime.getProperties method whil ...@@ -42,8 +42,6 @@ let { Protocol } = InspectorTest.start('Checks Runtime.getProperties method whil
let objectId = await evaluateToObjectId('new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1]).buffer'); let objectId = await evaluateToObjectId('new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1]).buffer');
let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true }); let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true });
for (let prop of props.result.result) { for (let prop of props.result.result) {
if (prop.name === '__proto__')
continue;
InspectorTest.log(prop.name); InspectorTest.log(prop.name);
await logGetPropertiesResult(prop.value.objectId); await logGetPropertiesResult(prop.value.objectId);
} }
......
...@@ -54,6 +54,17 @@ Running test: testSetVariableValueMain ...@@ -54,6 +54,17 @@ Running test: testSetVariableValueMain
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -67,19 +78,6 @@ Running test: testSetVariableValueMain ...@@ -67,19 +78,6 @@ Running test: testSetVariableValueMain
} }
writable : true writable : true
} }
[1] : {
configurable : true
enumerable : false
isOwn : true
name : __proto__
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
writable : true
}
] ]
} }
} }
...@@ -98,6 +96,18 @@ Running test: testSetVariableValueMain ...@@ -98,6 +96,18 @@ Running test: testSetVariableValueMain
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : {
className : Array
description : Array(0)
objectId : <objectId>
subtype : array
type : object
}
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -144,20 +154,6 @@ Running test: testSetVariableValueMain ...@@ -144,20 +154,6 @@ Running test: testSetVariableValueMain
} }
writable : true writable : true
} }
[4] : {
configurable : true
enumerable : false
isOwn : true
name : __proto__
value : {
className : Array
description : Array(0)
objectId : <objectId>
subtype : array
type : object
}
writable : true
}
] ]
} }
} }
...@@ -175,6 +171,17 @@ Running test: testSetVariableValueMain ...@@ -175,6 +171,17 @@ Running test: testSetVariableValueMain
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -188,19 +195,6 @@ Running test: testSetVariableValueMain ...@@ -188,19 +195,6 @@ Running test: testSetVariableValueMain
} }
writable : true writable : true
} }
[1] : {
configurable : true
enumerable : false
isOwn : true
name : __proto__
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
writable : true
}
] ]
} }
} }
......
...@@ -824,6 +824,11 @@ Running test: testObjInheritsGetterProperty ...@@ -824,6 +824,11 @@ Running test: testObjInheritsGetterProperty
type : number type : number
value : NaN value : NaN
} }
[1] : {
name : __proto__
type : object
value : Object
}
] ]
type : object type : object
} }
......
Checks Runtime.getProperties method Checks Runtime.getProperties method
Running test: testObject5 Running test: testObject5
__proto__ own object undefined
foo own string cat foo own string cat
Internal properties Internal properties
[[PrimitiveValue]] number 5 [[PrimitiveValue]] number 5
[[Prototype]] object undefined
Running test: testNotOwn Running test: testNotOwn
__defineGetter__ inherited function undefined __defineGetter__ inherited function undefined
...@@ -23,6 +23,8 @@ Running test: testNotOwn ...@@ -23,6 +23,8 @@ 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
[[Prototype]] object undefined
Running test: testAccessorsOnly Running test: testAccessorsOnly
b own no value, getter, setter b own no value, getter, setter
...@@ -32,33 +34,38 @@ Running test: testArray ...@@ -32,33 +34,38 @@ Running test: testArray
0 own string red 0 own string red
1 own string green 1 own string green
2 own string blue 2 own string blue
__proto__ own object undefined
length own number 3 length own number 3
Internal properties
[[Prototype]] object undefined
Running test: testBound Running test: testBound
__proto__ own function undefined
length own number 0 length own number 0
name own string bound Number name own string bound Number
Internal properties Internal properties
[[BoundArgs]] object undefined [[BoundArgs]] object undefined
[[BoundThis]] object undefined [[BoundThis]] object undefined
[[Prototype]] function undefined
[[TargetFunction]] function undefined [[TargetFunction]] function undefined
Running test: testObjectThrowsLength Running test: testObjectThrowsLength
__proto__ own object undefined
length own no value, getter length own no value, getter
Internal properties
[[Prototype]] object undefined
Running test: testTypedArrayWithoutLength Running test: testTypedArrayWithoutLength
__proto__ own object undefined Internal properties
[[Prototype]] object undefined
Running test: testClassWithPrivateFields Running test: testClassWithPrivateFields
__proto__ own object undefined
baz own number 4 baz own number 4
Internal properties
[[Prototype]] object undefined
Private properties Private properties
#bar number 3 #bar number 3
#foo number 2 #foo number 2
__proto__ own object undefined
baz own number 4 baz own number 4
Internal properties
[[Prototype]] object undefined
Private properties Private properties
#bar number 3 #bar number 3
#baz number 1 #baz number 1
...@@ -72,6 +79,13 @@ Private properties ...@@ -72,6 +79,13 @@ Private properties
#foo number 2 #foo number 2
Running test: testArrayBuffer Running test: testArrayBuffer
[[Prototype]]
Symbol(Symbol.toStringTag) own string ArrayBuffer
byteLength own no value, getter
constructor own function undefined
slice own function undefined
Internal properties
[[Prototype]] object undefined
[[Int8Array]] [[Int8Array]]
0 own number 1 0 own number 1
1 own number 1 1 own number 1
...@@ -81,7 +95,8 @@ Running test: testArrayBuffer ...@@ -81,7 +95,8 @@ Running test: testArrayBuffer
5 own number 1 5 own number 1
6 own number 1 6 own number 1
7 own number 1 7 own number 1
__proto__ own object undefined Internal properties
[[Prototype]] object undefined
[[Uint8Array]] [[Uint8Array]]
0 own number 1 0 own number 1
1 own number 1 1 own number 1
...@@ -91,21 +106,31 @@ Running test: testArrayBuffer ...@@ -91,21 +106,31 @@ Running test: testArrayBuffer
5 own number 1 5 own number 1
6 own number 1 6 own number 1
7 own number 1 7 own number 1
__proto__ own object undefined Internal properties
[[Prototype]] object undefined
[[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 Internal properties
[[Prototype]] object undefined
[[Int32Array]] [[Int32Array]]
0 own number 16843009 0 own number 16843009
1 own number 16843009 1 own number 16843009
__proto__ own object undefined Internal properties
[[Prototype]] object undefined
[[ArrayBufferByteLength]] [[ArrayBufferByteLength]]
[[ArrayBufferData]] [[ArrayBufferData]]
Running test: testArrayBufferFromWebAssemblyMemory Running test: testArrayBufferFromWebAssemblyMemory
[[Prototype]]
Symbol(Symbol.toStringTag) own string ArrayBuffer
byteLength own no value, getter
constructor own function undefined
slice own function undefined
Internal properties
[[Prototype]] object undefined
[[Int8Array]] [[Int8Array]]
[[Uint8Array]] [[Uint8Array]]
[[Int16Array]] [[Int16Array]]
...@@ -113,18 +138,22 @@ Running test: testArrayBufferFromWebAssemblyMemory ...@@ -113,18 +138,22 @@ Running test: testArrayBufferFromWebAssemblyMemory
[[ArrayBufferByteLength]] [[ArrayBufferByteLength]]
[[ArrayBufferData]] [[ArrayBufferData]]
[[WebAssemblyMemory]] [[WebAssemblyMemory]]
__proto__ own object undefined Internal properties
[[Prototype]] object undefined
Running test: testDetachedArrayBuffer Running test: testDetachedArrayBuffer
[[Prototype]] undefined
[[IsDetached]] true [[IsDetached]] true
Running test: testArrayBufferWithBrokenUintCtor Running test: testArrayBufferWithBrokenUintCtor
__proto__ own object undefined
Internal properties Internal properties
[[ArrayBufferByteLength]] number 7 [[ArrayBufferByteLength]] number 7
[[ArrayBufferData]] string 0x... [[ArrayBufferData]] string 0x...
[[Int8Array]] object undefined [[Int8Array]] object undefined
[[Prototype]] object undefined
[[Uint8Array]] object undefined [[Uint8Array]] object undefined
Running test: testObjectWithProtoProperty Running test: testObjectWithProtoProperty
__proto__ own object undefined __proto__ own object undefined
Internal properties
[[Prototype]] object undefined
...@@ -45,8 +45,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -45,8 +45,6 @@ InspectorTest.runAsyncTestSuite([
let objectId = await evaluateToObjectId('new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1]).buffer'); let objectId = await evaluateToObjectId('new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1]).buffer');
let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true }); let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true });
for (let prop of props.result.result) { for (let prop of props.result.result) {
if (prop.name === '__proto__')
continue;
InspectorTest.log(prop.name); InspectorTest.log(prop.name);
await logGetPropertiesResult(prop.value.objectId); await logGetPropertiesResult(prop.value.objectId);
} }
...@@ -61,8 +59,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -61,8 +59,6 @@ InspectorTest.runAsyncTestSuite([
let objectId = await evaluateToObjectId('new WebAssembly.Memory({initial: 1}).buffer'); let objectId = await evaluateToObjectId('new WebAssembly.Memory({initial: 1}).buffer');
let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true }); let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true });
for (let prop of props.result.result) { for (let prop of props.result.result) {
if (prop.name === '__proto__')
continue;
InspectorTest.log(prop.name); InspectorTest.log(prop.name);
await logGetPropertiesResult(prop.value.objectId); await logGetPropertiesResult(prop.value.objectId);
} }
...@@ -84,8 +80,6 @@ InspectorTest.runAsyncTestSuite([ ...@@ -84,8 +80,6 @@ InspectorTest.runAsyncTestSuite([
await Protocol.Runtime.evaluate({ expression: 'b', generatePreview: true }) await Protocol.Runtime.evaluate({ expression: 'b', generatePreview: true })
let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true }); let props = await Protocol.Runtime.getProperties({ objectId, ownProperties: true });
for (let prop of props.result.result) { for (let prop of props.result.result) {
if (prop.name === '__proto__')
continue;
InspectorTest.log(prop.name); InspectorTest.log(prop.name);
await logGetPropertiesResult(prop.value.objectId); await logGetPropertiesResult(prop.value.objectId);
} }
......
...@@ -4,6 +4,17 @@ Running test: testObject ...@@ -4,6 +4,17 @@ Running test: testObject
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -17,25 +28,23 @@ Running test: testObject ...@@ -17,25 +28,23 @@ Running test: testObject
} }
writable : true writable : true
} }
[1] : { ]
configurable : true }
enumerable : false }
isOwn : true {
name : __proto__ id : <messageId>
result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : { value : {
className : Object className : Object
description : Object description : Object
objectId : <objectId> objectId : <objectId>
type : object type : object
} }
writable : true
} }
] ]
}
}
{
id : <messageId>
result : {
result : [ result : [
[0] : { [0] : {
configurable : false configurable : false
...@@ -120,19 +129,6 @@ Running test: testObject ...@@ -120,19 +129,6 @@ Running test: testObject
} }
writable : false writable : false
} }
[6] : {
configurable : true
enumerable : false
isOwn : true
name : __proto__
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
writable : true
}
] ]
} }
} }
...@@ -5,6 +5,17 @@ Retrieving properties in 2 ...@@ -5,6 +5,17 @@ Retrieving properties in 2
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -18,26 +29,24 @@ Retrieving properties in 2 ...@@ -18,26 +29,24 @@ Retrieving properties in 2
} }
writable : true writable : true
} }
[1] : { ]
configurable : true }
enumerable : false }
isOwn : true Retrieving properties in 1
name : __proto__ {
id : <messageId>
result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : { value : {
className : Object className : Object
description : Object description : Object
objectId : <objectId> objectId : <objectId>
type : object type : object
} }
writable : true
} }
] ]
}
}
Retrieving properties in 1
{
id : <messageId>
result : {
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -51,19 +60,6 @@ Retrieving properties in 1 ...@@ -51,19 +60,6 @@ Retrieving properties in 1
} }
writable : true writable : true
} }
[1] : {
configurable : true
enumerable : false
isOwn : true
name : __proto__
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
writable : true
}
] ]
} }
} }
...@@ -72,6 +68,17 @@ Retrieving properties in 1 ...@@ -72,6 +68,17 @@ Retrieving properties in 1
{ {
id : <messageId> id : <messageId>
result : { result : {
internalProperties : [
[0] : {
name : [[Prototype]]
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
}
]
result : [ result : [
[0] : { [0] : {
configurable : true configurable : true
...@@ -85,19 +92,6 @@ Retrieving properties in 1 ...@@ -85,19 +92,6 @@ Retrieving properties in 1
} }
writable : true writable : true
} }
[1] : {
configurable : true
enumerable : false
isOwn : true
name : __proto__
value : {
className : Object
description : Object
objectId : <objectId>
type : object
}
writable : 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