Commit f9a3e6a6 authored by yangguo's avatar yangguo Committed by Commit bot

Debugger: do not expose global object.

Review URL: https://codereview.chromium.org/1290063002

Cr-Commit-Position: refs/heads/master@{#30149}
parent 3d01d31f
......@@ -228,7 +228,7 @@ MaybeHandle<JSObject> ScopeIterator::ScopeObject() {
DCHECK(!failed_);
switch (Type()) {
case ScopeIterator::ScopeTypeGlobal:
return Handle<JSObject>(CurrentContext()->global_object());
return Handle<JSObject>(CurrentContext()->global_proxy());
case ScopeIterator::ScopeTypeScript:
return MaterializeScriptScope();
case ScopeIterator::ScopeTypeLocal:
......
......@@ -1399,6 +1399,11 @@ static int DebugReferencedBy(HeapIterator* iterator, JSObject* target,
}
}
// Do not expose the global object directly.
if (obj->IsJSGlobalObject()) {
obj = JSGlobalObject::cast(obj)->global_proxy();
}
if (obj != NULL) {
// Valid reference found add to instance array if supplied an update
// count.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment