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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js

Issue 1815753002: [DevTools] Move getFunctionDetails to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-get-internal-properties
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/v8_inspector/InjectedScript.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
diff --git a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
index 14eeaa2fef7272912e0b6b2b8a5e1ef4e00dc47d..f4c38439e40102e8e2ba895774b222a8079d4844 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
@@ -48,6 +48,15 @@ DebuggerScript.getAfterCompileScript = function(eventData)
return DebuggerScript._formatScript(eventData.script_.script_);
}
+DebuggerScript._scopeTypeNames = { __proto__: null };
+DebuggerScript._scopeTypeNames[ScopeType.Global] = "global";
+DebuggerScript._scopeTypeNames[ScopeType.Local] = "local";
+DebuggerScript._scopeTypeNames[ScopeType.With] = "with";
+DebuggerScript._scopeTypeNames[ScopeType.Closure] = "closure";
+DebuggerScript._scopeTypeNames[ScopeType.Catch] = "catch";
+DebuggerScript._scopeTypeNames[ScopeType.Block] = "block";
+DebuggerScript._scopeTypeNames[ScopeType.Script] = "script";
+
DebuggerScript.getFunctionScopes = function(fun)
{
var mirror = MakeMirror(fun);
@@ -63,9 +72,9 @@ DebuggerScript.getFunctionScopes = function(fun)
if (!scopeObject)
continue;
result.push({
- type: scopeDetails.type(),
+ type: DebuggerScript._scopeTypeNames[scopeDetails.type()],
object: scopeObject,
- name: scopeDetails.name()
+ name: scopeDetails.name() || ""
});
}
return result;
@@ -432,7 +441,7 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
for (var i = 0, j = 0; i < scopeObjects.length; ++i) {
var scopeObject = DebuggerScript._buildScopeObject(scopeTypes[i], scopeObjects[i]);
if (scopeObject) {
- scopeTypes[j] = scopeTypes[i];
+ scopeTypes[j] = DebuggerScript._scopeTypeNames[scopeTypes[i]];
scopeNames[j] = scopeNames[i];
scopeChain[j] = scopeObject;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/v8_inspector/InjectedScript.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698