include equivalent?

3 views
Skip to first unread message

Colin

unread,
Jan 5, 2010, 10:07:48 PM1/5/10
to v8-users
I want to create an include function in my embedded app using V8.
Currently I'm using

eval(get_file_contents('./js/functions.js'));

to sorta do the same thing, but is there a better way? I tried to make
a function, and it worked fine, but the script executed in the new
scope of the function. Is there a way to maybe execute a script under
a different scope?

Louis Santillan

unread,
Jan 5, 2010, 11:27:40 PM1/5/10
to v8-u...@googlegroups.com
samples/shell.cc and src/d8.cc implement a load() function similar to
php's include().

-Louis

> --
> v8-users mailing list
> v8-u...@googlegroups.com
> http://groups.google.com/group/v8-users
>

Reply all
Reply to author
Forward
0 new messages