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

Unified Diff: Source/core/inspector/InjectedScriptSource.js

Issue 738733006: DevTools: Support harmony variable scopes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 6 years, 1 month 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: Source/core/inspector/InjectedScriptSource.js
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index 4db9b06480347e5317e682e031e2a18f1e767271..dbeae7346c6fc65707511ba939e102d2e8d49998 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -1429,6 +1429,21 @@ InjectedScript.CallFrameProxy.prototype = {
}
/**
+ * @const
+ * @type {!Object.<number, !DebuggerAgent.ScopeType>}
+ */
+InjectedScript.CallFrameProxy._scopeTypeNames = {
+ 0: "global",
+ 1: "local",
+ 2: "with",
+ 3: "closure",
+ 4: "catch",
+ 5: "block",
+ 6: "script",
+ __proto__: null
+};
+
+/**
* @param {number} scopeTypeCode
* @param {*} scopeObject
* @param {string} groupId
@@ -1436,23 +1451,9 @@ InjectedScript.CallFrameProxy.prototype = {
*/
InjectedScript.CallFrameProxy._createScopeJson = function(scopeTypeCode, scopeObject, groupId)
{
- const GLOBAL_SCOPE = 0;
- const LOCAL_SCOPE = 1;
- const WITH_SCOPE = 2;
- const CLOSURE_SCOPE = 3;
- const CATCH_SCOPE = 4;
-
- /** @type {!Object.<number, string>} */
- var scopeTypeNames = { __proto__: null };
- scopeTypeNames[GLOBAL_SCOPE] = "global";
- scopeTypeNames[LOCAL_SCOPE] = "local";
- scopeTypeNames[WITH_SCOPE] = "with";
- scopeTypeNames[CLOSURE_SCOPE] = "closure";
- scopeTypeNames[CATCH_SCOPE] = "catch";
-
return {
object: injectedScript._wrapObject(scopeObject, groupId),
- type: /** @type {!DebuggerAgent.ScopeType} */ (scopeTypeNames[scopeTypeCode]),
+ type: InjectedScript.CallFrameProxy._scopeTypeNames[scopeTypeCode],
__proto__: null
};
}
« no previous file with comments | « Source/bindings/core/v8/DebuggerScript.js ('k') | Source/devtools/front_end/components/ObjectPropertiesSection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698