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

Unified Diff: Source/bindings/core/v8/DebuggerScript.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/bindings/core/v8/DebuggerScript.js
diff --git a/Source/bindings/core/v8/DebuggerScript.js b/Source/bindings/core/v8/DebuggerScript.js
index ddabaa755389dad0fae6d6919e06cee762bd9bbf..bea3c4570366664d6c51776c1ce5e6ef862af5c1 100644
--- a/Source/bindings/core/v8/DebuggerScript.js
+++ b/Source/bindings/core/v8/DebuggerScript.js
@@ -526,12 +526,18 @@ DebuggerScript._buildScopeObject = function(scopeType, scopeObject)
case ScopeType.Local:
case ScopeType.Closure:
case ScopeType.Catch:
+ case ScopeType.Block:
+ case ScopeType.Script:
// For transient objects we create a "persistent" copy that contains
// the same properties.
// Reset scope object prototype to null so that the proto properties
// don't appear in the local scope section.
- result = { __proto__: null };
var properties = MakeMirror(scopeObject, true /* transient */).properties();
+ // Almost always Script scope will be empty, so just filter out that noise.
+ // Also drop empty Block scopes, should we get any.
+ if (!properties.length && (scopeType === ScopeType.Script || scopeType === ScopeType.Block))
+ break;
+ result = { __proto__: null };
for (var j = 0; j < properties.length; j++) {
var name = properties[j].name();
if (name.charAt(0) === ".")
@@ -543,9 +549,6 @@ DebuggerScript._buildScopeObject = function(scopeType, scopeObject)
case ScopeType.With:
result = scopeObject;
break;
- case ScopeType.Block:
- // Unsupported yet. Mustn't be reachable.
- break;
}
return result;
}

Powered by Google App Engine
This is Rietveld 408576698