Modified: trunk/LayoutTests/inspector/runtime/getProperties-expected.txt (202665 => 202666)
--- trunk/LayoutTests/inspector/runtime/getProperties-expected.txt 2016-06-30 04:17:33 UTC (rev 202665)
+++ trunk/LayoutTests/inspector/runtime/getProperties-expected.txt 2016-06-30 04:19:42 UTC (rev 202666)
@@ -20,8 +20,8 @@
__proto__ function function () {
[native code]
}
- arguments object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.
- caller object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.
+ arguments getter setter
+ caller getter setter
length number 0
name string bound Number
Internal properties:
@@ -37,8 +37,8 @@
__proto__ function function () {
[native code]
}
- arguments object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.
- caller object TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in strict mode.
+ arguments getter setter
+ caller getter setter
length number 0
name string bound
Internal properties:
Modified: trunk/LayoutTests/inspector/runtime/getProperties.html (202665 => 202666)
--- trunk/LayoutTests/inspector/runtime/getProperties.html 2016-06-30 04:17:33 UTC (rev 202665)
+++ trunk/LayoutTests/inspector/runtime/getProperties.html 2016-06-30 04:19:42 UTC (rev 202666)
@@ -80,11 +80,13 @@
}
function dumpSingleProperty(property) {
- var {name, value} = property;
+ var {name, value, get, set} = property;
if (value)
- ProtocolTest.log(" " + name + " " + value.type + " " + (value.value || value.description));
+ ProtocolTest.log(` ${name} ${value.type} ${value.value || value.description}`);
+ else if (get || set)
+ ProtocolTest.log(` ${name} ${get ? "getter" : "-"} ${set ? "setter" : ""}`);
else
- ProtocolTest.log(" " + name);
+ ProtocolTest.log(` ${name}`);
}
function NamedThingComparator(o1, o2) {
Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js (202665 => 202666)
--- trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js 2016-06-30 04:17:33 UTC (rev 202665)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js 2016-06-30 04:19:42 UTC (rev 202666)
@@ -251,7 +251,7 @@
return result;
},
- _getProperties: function(objectId, collectionMode, generatePreview)
+ _getProperties: function(objectId, collectionMode, generatePreview, nativeGettersAsValues)
{
var parsedObjectId = this._parseObjectId(objectId);
var object = this._objectForId(parsedObjectId);
@@ -263,7 +263,7 @@
if (isSymbol(object))
return false;
- var descriptors = this._propertyDescriptors(object, collectionMode);
+ var descriptors = this._propertyDescriptors(object, collectionMode, nativeGettersAsValues);
// Go over properties, wrap object values.
for (var i = 0; i < descriptors.length; ++i) {
@@ -287,14 +287,16 @@
getProperties: function(objectId, ownProperties, generatePreview)
{
+ var nativeGettersAsValues = false;
var collectionMode = ownProperties ? InjectedScript.CollectionMode.OwnProperties : InjectedScript.CollectionMode.AllProperties;
- return this._getProperties(objectId, collectionMode, generatePreview);
+ return this._getProperties(objectId, collectionMode, generatePreview, nativeGettersAsValues);
},
getDisplayableProperties: function(objectId, generatePreview)
{
+ var nativeGettersAsValues = true;
var collectionMode = InjectedScript.CollectionMode.OwnProperties | InjectedScript.CollectionMode.NativeGetterProperties;
- return this._getProperties(objectId, collectionMode, generatePreview);
+ return this._getProperties(objectId, collectionMode, generatePreview, nativeGettersAsValues);
},
getInternalProperties: function(objectId, generatePreview)
@@ -570,7 +572,7 @@
return descriptors;
},
- _propertyDescriptors: function(object, collectionMode)
+ _propertyDescriptors: function(object, collectionMode, nativeGettersAsValues)
{
var descriptors = [];
var nameProcessed = new Set;
@@ -612,11 +614,7 @@
// Native Getter properties.
if (collectionMode & InjectedScript.CollectionMode.NativeGetterProperties) {
- // FIXME: <https://webkit.org/b/140575> Web Inspector: Native Bindings Descriptors are Incomplete
- // if (descriptor.hasOwnProperty("get") && descriptor.get && isNativeFunction(descriptor.get)) { ... }
-
if (possibleNativeBindingGetter) {
- // Possible getter property in the prototype chain.
descriptors.push(descriptor);
return;
}
@@ -644,15 +642,14 @@
continue;
}
- if (endsWith(String(descriptor.get), "[native code]\n}") ||
- (!descriptor.get && descriptor.hasOwnProperty("get") && !descriptor.set && descriptor.hasOwnProperty("set"))) {
- // FIXME: Some Native Bindings Descriptors are Incomplete
- // <https://webkit.org/b/141585> Some IDL attributes appear on the instances instead of on prototypes
- // Developers may create such a descriptors, so we should be resilient:
- // var x = {}; Object.defineProperty(x, "p", {get:undefined}); Object.getOwnPropertyDescriptor(x, "p")
- var fakeDescriptor = createFakeValueDescriptor(name, symbol, descriptor, isOwnProperty, true);
- processDescriptor(fakeDescriptor, isOwnProperty, true);
- continue;
+ if (nativeGettersAsValues) {
+ if (endsWith(String(descriptor.get), "[native code]\n}") || (!descriptor.get && descriptor.hasOwnProperty("get") && !descriptor.set && descriptor.hasOwnProperty("set"))) {
+ // Developers may create such a descriptor, so we should be resilient:
+ // var x = {}; Object.defineProperty(x, "p", {get:undefined}); Object.getOwnPropertyDescriptor(x, "p")
+ var fakeDescriptor = createFakeValueDescriptor(name, symbol, descriptor, isOwnProperty, true);
+ processDescriptor(fakeDescriptor, isOwnProperty, true);
+ continue;
+ }
}
descriptor.name = name;
@@ -1043,7 +1040,8 @@
return preview;
// Properties.
- var descriptors = injectedScript._propertyDescriptors(object, InjectedScript.CollectionMode.AllProperties);
+ var nativeGettersAsValues = true;
+ var descriptors = injectedScript._propertyDescriptors(object, InjectedScript.CollectionMode.AllProperties, nativeGettersAsValues);
this._appendPropertyPreviews(object, preview, descriptors, false, propertiesThreshold, firstLevelKeys, secondLevelKeys);
if (propertiesThreshold.indexes < 0 || propertiesThreshold.properties < 0)
return preview;