Index: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
index 27c6654ac05900f7b7272db5b86f7dce987913c5..4ec202ba43ab4a68f355ddddbe584a91f3bec8e2 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js |
@@ -526,9 +526,31 @@ WebInspector.ExecutionContext.prototype = { |
} |
/** |
+ * @param {?Array<!WebInspector.RemoteObjectProperty>} properties |
+ * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties |
+ * @this {WebInspector.ExecutionContext} |
+ */ |
+ function completionsForProxyTarget(properties, internalProperties) |
+ { |
+ if (internalProperties) { |
lushnikov
2016/05/04 19:27:21
lets use as much fast returns as possible! the les
pfeldman
2016/05/04 22:45:07
+1
kozy
2016/05/05 00:51:08
Done.
|
+ for (var property of internalProperties) { |
+ if (property.name === "[[Target]]") { |
+ var target = property.value; |
+ if (target.subtype !== "proxy") |
+ target.callFunctionJSON(getCompletions, [WebInspector.RemoteObject.toCallArgument(target.subtype)], receivedPropertyNames.bind(this)); |
+ else |
+ target.getOwnProperties(completionsForProxyTarget.bind(this)); |
+ return; |
+ } |
+ } |
+ } |
+ completionsReadyCallback([]); |
+ } |
+ |
+ /** |
* @param {string=} type |
* @suppressReceiverCheck |
- * @this {WebInspector.ExecutionContext} |
+ * @this {*} |
*/ |
function getCompletions(type) |
{ |
@@ -547,7 +569,7 @@ WebInspector.ExecutionContext.prototype = { |
for (var o = object; o; o = o.__proto__) { |
if (type === "array" && o === object && ArrayBuffer.isView(o) && o.length > 9999) |
continue; |
- var names = Object.getOwnPropertyNames(o); |
+ var names = Object.getOwnPropertyNames(/** @type{!Object} */(o)); |
var isArray = Array.isArray(o); |
for (var i = 0; i < names.length; ++i) { |
// Skip array elements indexes. |
@@ -561,7 +583,9 @@ WebInspector.ExecutionContext.prototype = { |
return resultSet; |
} |
- if (result.type === "object" || result.type === "function") |
+ if (result.type === "object" && result.subtype === "proxy") |
lushnikov
2016/05/04 19:27:21
result = extractTarget(result).then(onTarget);
f
kozy
2016/05/05 00:51:08
Done.
|
+ result.getOwnProperties(completionsForProxyTarget.bind(this)); |
+ else if (result.type === "object" || result.type === "function") |
result.callFunctionJSON(getCompletions, [WebInspector.RemoteObject.toCallArgument(result.subtype)], receivedPropertyNames.bind(this)); |
else if (result.type === "string" || result.type === "number" || result.type === "boolean") |
this.evaluate("(" + getCompletions + ")(\"" + result.type + "\")", "completion", false, true, true, false, false, receivedPropertyNamesFromEval.bind(this)); |