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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js

Issue 2557763003: DevTools: sort completions by prototype. (Closed)
Patch Set: rebaselined Created 4 years 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/sdk/DebuggerModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
index 7312c980c7ab6079828771caea67357f30162114..60fcf439d074939482ae349357084dac86767572 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -1148,28 +1148,6 @@ SDK.DebuggerModel.CallFrame = class extends SDK.SDKObject {
}
this._debuggerAgent.restartFrame(this._payload.callFrameId, protocolCallback.bind(this));
}
-
- /**
- * @param {function(!Object)} callback
- */
- variableNames(callback) {
- var result = {this: true};
-
- function propertiesCollected(properties) {
- for (var i = 0; properties && i < properties.length; ++i)
- result[properties[i].name] = true;
- if (--pendingRequests === 0)
- callback(result);
- }
-
- var scopeChain = this.scopeChain();
- var pendingRequests = scopeChain.length;
- for (var i = 0; i < scopeChain.length; ++i) {
- var scope = scopeChain[i];
- var object = scope.object();
- object.getAllProperties(false, propertiesCollected);
- }
- }
};
@@ -1210,6 +1188,30 @@ SDK.DebuggerModel.Scope = class {
}
/**
+ * @return {string}
+ */
+ typeName() {
+ switch (this._type) {
+ case Protocol.Debugger.ScopeType.Local:
+ return Common.UIString('Local');
+ case Protocol.Debugger.ScopeType.Closure:
+ return Common.UIString('Closure');
+ case Protocol.Debugger.ScopeType.Catch:
+ return Common.UIString('Catch');
+ case Protocol.Debugger.ScopeType.Block:
+ return Common.UIString('Block');
+ case Protocol.Debugger.ScopeType.Script:
+ return Common.UIString('Script');
+ case Protocol.Debugger.ScopeType.With:
+ return Common.UIString('With Block');
+ case Protocol.Debugger.ScopeType.Global:
+ return Common.UIString('Global');
+ }
+ return '';
+ }
+
+
+ /**
* @return {string|undefined}
*/
name() {

Powered by Google App Engine
This is Rietveld 408576698