I need to run scripts that use a convention of "this" refering to a
specific, otherwise-unnamed object. Is there a way to make v8 handle
that convention?
So far the only work-around I can think of is to provide the global
template with an explicit property to refer to the object
(implicitThisObj say). Then I'd alter the incoming <script-text> to
be
On 2 May 2012 17:58, Glidos <goo...@glidos.net> wrote:
> I need to run scripts that use a convention of "this" refering to a
> specific, otherwise-unnamed object. Is there a way to make v8 handle
> that convention?
> So far the only work-around I can think of is to provide the global
> template with an explicit property to refer to the object
> (implicitThisObj say). Then I'd alter the incoming <script-text> to
> be
Thanks. Both apply and call are improvements over my attempt, but
maybe I don't need any tricks:
if I just get v8 to execute <script-text> directly, will "this" refer
to the global object?
> Thanks. Both apply and call are improvements over my attempt, but
> maybe I don't need any tricks:
> if I just get v8 to execute <script-text> directly, will "this" refer
> to the global object?
> Yes. The global object of the context within which you execute the script.
> from my hacked android ;)
> On May 2, 2012 5:13 PM, "Glidos" <goo...@glidos.net> wrote:
> > Thanks. Both apply and call are improvements over my attempt, but
> > maybe I don't need any tricks:
> > if I just get v8 to execute <script-text> directly, will "this" refer
> > to the global object?