JSGlobalProxy represents an iframe, whereas JSGlobalObject is the actual
state of a page loaded in an iframe. Hence when you navigate an iframe, the
JSGlobalProxy is relinked to a new JSGlobalObject. From JS the
JSGlobalObject is hidden behind the JSGlobalProxy and invisible.

As long as the iframe is pointed at the page running specific JS, there's
not much difference between a global reference "x" (directly accessing the
JSGlobalObject unless it's a lexical binding, let, const) and "this.x"
(accessing the global object via the JSGlobalProxy). However, if you now
navigate the iframe to a new location; "x" will still point to the old
global property, whereas this.x will try to load "x" from the new
JSGlobalObject behind the reused JSGlobalProxy.

HTH

On Tue, Mar 1, 2016 at 3:27 AM Yong Wang <[email protected]> wrote:

> Hi all,
>     I read v8 source code a little recently.
> I confused between JSGlobalProxy and GlobalObject.
>
>    could someone can explain what relationship between JSGlobalProxy and
> GlobalObject.
>
> Thanks in advance.
>
> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to