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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js

Issue 2603053002: [Devtools] Type externs global namespaces (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Components.JavaScriptAutocomplete = {}; 5 Components.JavaScriptAutocomplete = {};
6 6
7 /** @typedef {{title:(string|undefined), items:Array<string>}} */ 7 /** @typedef {{title:(string|undefined), items:Array<string>}} */
8 Components.JavaScriptAutocomplete.CompletionGroup; 8 Components.JavaScriptAutocomplete.CompletionGroup;
9 9
10 /** 10 /**
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 // User is creating an array, do not suggest anything. 70 // User is creating an array, do not suggest anything.
71 if (bracketNotation && !expressionString) 71 if (bracketNotation && !expressionString)
72 return Promise.resolve([]); 72 return Promise.resolve([]);
73 73
74 if (!query && !expressionString && !force) 74 if (!query && !expressionString && !force)
75 return Promise.resolve([]); 75 return Promise.resolve([]);
76 76
77 var fufill; 77 var fufill;
78 var promise = new Promise(x => fufill = x); 78 var promise = new Promise(x => fufill = x);
79 if (!expressionString && executionContext.debuggerModel.selectedCallFrame()) 79 var selectedFrame = executionContext.debuggerModel.selectedCallFrame();
80 variableNamesInScopes(executionContext.debuggerModel.selectedCallFrame(), re ceivedPropertyNames); 80 if (!expressionString && selectedFrame)
81 variableNamesInScopes(selectedFrame, receivedPropertyNames);
81 else 82 else
82 executionContext.evaluate(expressionString, 'completion', true, true, false, false, false, evaluated); 83 executionContext.evaluate(expressionString, 'completion', true, true, false, false, false, evaluated);
83 84
84 return promise; 85 return promise;
85 /** 86 /**
86 * @param {?SDK.RemoteObject} result 87 * @param {?SDK.RemoteObject} result
87 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails 88 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails
88 */ 89 */
89 function evaluated(result, exceptionDetails) { 90 function evaluated(result, exceptionDetails) {
90 if (!result || !!exceptionDetails) { 91 if (!result || !!exceptionDetails) {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 var structuredGroup = 326 var structuredGroup =
326 caseSensitivePrefix.concat(caseInsensitivePrefix, caseSensitiveAnywhere, caseInsensitiveAnywhere); 327 caseSensitivePrefix.concat(caseInsensitivePrefix, caseSensitiveAnywhere, caseInsensitiveAnywhere);
327 if (structuredGroup.length && group.title !== lastGroupTitle) { 328 if (structuredGroup.length && group.title !== lastGroupTitle) {
328 structuredGroup[0].subtitle = group.title; 329 structuredGroup[0].subtitle = group.title;
329 lastGroupTitle = group.title; 330 lastGroupTitle = group.title;
330 } 331 }
331 result = result.concat(structuredGroup); 332 result = result.concat(structuredGroup);
332 } 333 }
333 return result; 334 return result;
334 }; 335 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698