Modified: releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/ChangeLog (249267 => 249268)
--- releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/ChangeLog 2019-08-29 13:11:11 UTC (rev 249267)
+++ releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/ChangeLog 2019-08-29 13:11:15 UTC (rev 249268)
@@ -1,3 +1,23 @@
+2019-08-28 Devin Rousso <[email protected]>
+
+ Web Inspector: REGRESSION(r249078): _javascript_ autocomplete doesn't work when evaluating properties of values
+ https://bugs.webkit.org/show_bug.cgi?id=201226
+
+ Reviewed by Joseph Pecoraro.
+
+ r249078 modified `WI._javascript_RuntimeCompletionProvider` to use arrays of property names
+ instead of objects for completion, but a few code paths were missed.
+
+ * UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js:
+ (WI._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
+ (WI._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNamesFromEvaluate):
+ (WI._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedObjectPropertyNames): Added.
+ (WI._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedArrayPropertyNames):
+
+ * UserInterface/Models/CallFrame.js:
+ (WI.CallFrame.prototype.collectScopeChainVariableNames):
+ (WI.CallFrame.prototype.collectScopeChainVariableNames.propertiesCollected):
+
2019-08-27 Devin Rousso <[email protected]>
Web Inspector: replace uses of added utility `Array.prototype.keySet` with an actual `Set`
Modified: releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js (249267 => 249268)
--- releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js 2019-08-29 13:11:11 UTC (rev 249267)
+++ releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js 2019-08-29 13:11:15 UTC (rev 249268)
@@ -165,7 +165,7 @@
if (wasThrown || !result || result.type === "undefined" || (result.type === "object" && result.subtype === "null")) {
WI.runtimeManager.activeExecutionContext.target.RuntimeAgent.releaseObjectGroup("completion");
- updateLastPropertyNames.call(this, {});
+ updateLastPropertyNames.call(this, []);
completionController.updateCompletions(defaultCompletions);
return;
@@ -226,7 +226,7 @@
if (result.subtype === "array")
result.callFunctionJSON(inspectedPage_evalResult_getArrayCompletions, undefined, receivedArrayPropertyNames.bind(this));
else if (result.type === "object" || result.type === "function")
- result.callFunctionJSON(inspectedPage_evalResult_getCompletions, undefined, receivedPropertyNames.bind(this));
+ result.callFunctionJSON(inspectedPage_evalResult_getCompletions, undefined, receivedObjectPropertyNames.bind(this));
else if (result.type === "string" || result.type === "number" || result.type === "boolean" || result.type === "symbol") {
let options = {objectGroup: "completion", includeCommandLineAPI: false, doNotPauseOnExceptionsAndMuteConsole: true, returnByValue: true, generatePreview: false, saveResult: false};
WI.runtimeManager.evaluateInInspectedWindow("(" + inspectedPage_evalResult_getCompletions + ")(\"" + result.type + "\")", options, receivedPropertyNamesFromEvaluate.bind(this));
@@ -236,9 +236,14 @@
function receivedPropertyNamesFromEvaluate(object, wasThrown, result)
{
- receivedPropertyNames.call(this, result && !wasThrown ? result.value : null);
+ receivedPropertyNames.call(this, result && !wasThrown ? Object.keys(result.value) : null);
}
+ function receivedObjectPropertyNames(propertyNames)
+ {
+ receivedPropertyNames.call(this, Object.keys(propertyNames));
+ }
+
function receivedArrayPropertyNames(propertyNames)
{
// FIXME: <https://webkit.org/b/143589> Web Inspector: Better handling for large collections in Object Trees
@@ -250,12 +255,13 @@
propertyNames[i] = true;
}
- receivedPropertyNames.call(this, propertyNames);
+ receivedObjectPropertyNames.call(this, propertyNames);
}
function receivedPropertyNames(propertyNames)
{
- propertyNames = propertyNames ? Object.keys(propertyNames) : [];
+ console.assert(!propertyNames || Array.isArray(propertyNames));
+ propertyNames = propertyNames || [];
updateLastPropertyNames.call(this, propertyNames);
Modified: releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/UserInterface/Models/CallFrame.js (249267 => 249268)
--- releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/UserInterface/Models/CallFrame.js 2019-08-29 13:11:11 UTC (rev 249267)
+++ releases/WebKitGTK/webkit-2.26/Source/WebInspectorUI/UserInterface/Models/CallFrame.js 2019-08-29 13:11:15 UTC (rev 249268)
@@ -70,7 +70,7 @@
collectScopeChainVariableNames(callback)
{
- var result = {this: true, __proto__: null};
+ let result = ["this", "__proto__"];
var pendingRequests = this._scopeChain.length;
@@ -77,7 +77,7 @@
function propertiesCollected(properties)
{
for (var i = 0; properties && i < properties.length; ++i)
- result[properties[i].name] = true;
+ result.push(properties[i].name);
if (--pendingRequests)
return;