Review URL: https://codereview.chromium.org/
1290063002
Cr-Commit-Position: refs/heads/master@{#30149}
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:
}
}
+ // 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.