Hey everyone,
Im currently implementing a v8 runtime for my javascript game engine and Im
stuck implementing the preloading stuff.
My intention: I want to map a natively implemented class to a javascript
namespace. I have implemented it that way that there's a lychee::Preloader
inside the native code available and it is usable in cpp code.
So my first idea was to map it just via ObjectTemplate, but that didnt work. My
next try was mapping all public methods to a plain ObjectTemplate that was put
to a string accessor inside the global namespace.
E.g. when Preloader is the created object via ObjectTemplate
Preloader->Set(String::New("load"),
FunctionTemplate::New(lychee::Preloader::load));
In this case I get a v8 error that there is an undefined reference.
lychee::Preloader itself is available in this line and there seem to be no
namespacing issues.
What to do there? Is there an example somewhere? I dont want to map hundrets of
methods, because the classes are also used inside the cpp context by other
classes.
Thanks, Christoph
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users