Chrome installs variables $foo = elem for all elems with id $foo in the DOM tree.
This is done using a named interceptor on the global object. best -jochen On Thu, Sep 18, 2014 at 2:42 PM, Danny Dorfman <[email protected]> wrote: > Suppose an HTML page looks something like this: > > <html> > <body> > <div id="d0">DDDDD</div> > <script> > alert("d0 = " + d0); > </script> > </body> > </html> > > When ran under Chrome the alert box will correctly state: > d0 = [object HTMLDivElement] > > How does V8 know that it needs to resolve the "d0" (as a DIV element), and > not return 'undefined'? > I need similar functionality in my code. > > -- > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" 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-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" 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.
