Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(850)

Unified Diff: third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js

Issue 2729743002: [DevTools] Move 'this' evaluation from ExecutionContext to autocomplete. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js
diff --git a/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js b/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js
index 78d6dcc73dcc71ced31bc1b9ffe4920fdf94d50b..9fa7447540dd36ef47317da258b5997304afa468 100644
--- a/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js
+++ b/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js
@@ -70,7 +70,7 @@ ObjectUI.JavaScriptAutocomplete._mapCompletions = function(text, query) {
var clippedExpression = ObjectUI.JavaScriptAutocomplete._clipExpression(text.substring(0, mapMatch.index));
var fulfill;
var promise = new Promise(x => fulfill = x);
- executionContext.evaluate(clippedExpression, 'completion', true, true, false, false, false, evaluated);
+ executionContext.evaluate(clippedExpression || 'this', 'completion', true, true, false, false, false, evaluated);
return promise;
/**
@@ -190,7 +190,7 @@ ObjectUI.JavaScriptAutocomplete.completionsForExpression = function(expressionSt
if (!expressionString && selectedFrame)
variableNamesInScopes(selectedFrame, receivedPropertyNames);
else
- executionContext.evaluate(expressionString, 'completion', true, true, false, false, false, evaluated);
+ executionContext.evaluate(expressionString || 'this', 'completion', true, true, false, false, false, evaluated);
return promise;
/**

Powered by Google App Engine
This is Rietveld 408576698