Convert global objects to global receivers before invoking
JavaScript functions on them. Review URL: http://codereview.chromium.org/165122 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2642 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
b290c323a9
commit
bcbef79a11
@ -83,6 +83,14 @@ static Handle<Object> Invoke(bool construct,
|
|||||||
code = stub.GetCode();
|
code = stub.GetCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert calls on global objects to be calls on the global
|
||||||
|
// receiver instead to avoid having a 'this' pointer which refers
|
||||||
|
// directly to a global object.
|
||||||
|
if (receiver->IsGlobalObject()) {
|
||||||
|
Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
|
||||||
|
receiver = Handle<JSObject>(global->global_receiver());
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Save and restore context around invocation and block the
|
// Save and restore context around invocation and block the
|
||||||
// allocation of handles without explicit handle scopes.
|
// allocation of handles without explicit handle scopes.
|
||||||
|
Loading…
Reference in New Issue
Block a user