On Wed, Mar 17, 2010 at 5:12 PM, Henrik Lindqvist <
henrik.lindqv...@gmail.com> wrote:

> If so, how do I allow for natives to be inherited in v8?
> Is this a v8 or JavaScript limitation, or it just can't be done?
>

Just a fore-warning... inheriting natives from JS can be tricky, depending
on how the native "this" object is decoded from the incoming JS "this"
handle. When multiple levels native inheritance are involved, it's possible
to end up with JS classes where calling one member function might work but
the next one (via a parent class somewhere else in the inheritance the
chain) might not be able to find its "this" pointer. (Been there, done
that.) Working around this type of problem requires, in my experience,
special care to be taken when implementing the C++ wrappers. There are
class-wrapping frameworks out there to help simplify this process. Mine,
e.g., is:

http://code.google.com/p/v8-juice/wiki/ClassWrap

i know a few other listers here have others, though.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/

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

Reply via email to