As Bryan White wrote you need to run the compiled script to get the
top level code executed. E.g. compiling the following script

 var a = 6
 function b() { return 7; }

will not create neither the global variable a nor the function b until
the script has been run. Running a script executes the top level code
including variable and function declerations.

Regards
Søren

On Mon, Mar 8, 2010 at 20:53, Seiji Sam Lee <[email protected]> wrote:

> I don't understand.
>
> If I can get the instance of the global object before run the code, why am
> I
> not able to get other instanced object which is a child of the global
> object? Is the global object the only instantiated object before run?
>
> Is it a different object the global object that I can get after compile
> (and
> before run) and the other one that I can get after run the script?
>
> Would it be possible to suggest a c++ prepare() method, called after
> compile
> and before run to prepare the space?
>
> Well, thanks in advance.
>
> -----Mensaje original-----
> De: [email protected] [mailto:[email protected]] En nombre
> de Bryan White
> Enviado el: lunes, 08 de marzo de 2010 13:34
> Para: [email protected]
> Asunto: Re: [v8-users] Is it posible?
>
> On Sat, Mar 6, 2010 at 1:58 PM, Seiji Sam Lee <[email protected]>
> wrote:
> > Well, is it posible to call a javascript function BEFORE run the script?
>
> Presuming you mean calling a function defined in the script, then no.
> The act of running the script loads the global objects defined in the
> script into the global space.
>
>
> --
> Bryan White
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to