How to inherit an JS Object?

87 views
Skip to first unread message

Henrik Lindqvist

unread,
Jan 27, 2010, 10:08:09 AM1/27/10
to v8-users
Since no one could answer:
http://groups.google.com/group/v8-users/browse_thread/thread/66b80bcaf7e4f404#

I'll rephrase the question:
How can I inherit from an built-in object, like Date, Error etc, from C
++ code? I see no way to get the FunctionTemplate from an Object. Is
there another way than using Inherit, or must I resort to executing JS
code?

Erik Corry

unread,
Feb 1, 2010, 2:59:32 AM2/1/10
to v8-u...@googlegroups.com
2010/1/27 Henrik Lindqvist <henrik.l...@gmail.com>:

Unfortunately there is no other way than to use JS code. You can't do
this through the API.

I have opened a feature request for this functionality to be added.

http://code.google.com/p/v8/issues/detail?id=595

--
Erik Corry

Henrik Lindqvist

unread,
Feb 1, 2010, 9:13:27 AM2/1/10
to v8-users
Thank you for answering.

When using v8 you have two option to interface with C/C++ code, either
you make low-level stubs in C++ and do the rest in JS, or, like I was
hoping, using only the C++ API.

I don't really like the first option, parsing files/strings on
startup, limited property option etc,. Native JS syntax would solve
some of the problems but that is only available for internal usage!?
Now it seems the C++ API isn't complete enough for the second option
either.


On Feb 1, 8:59 am, Erik Corry <erik.co...@gmail.com> wrote:
> 2010/1/27 Henrik Lindqvist <henrik.lindqv...@gmail.com>:


>
> > Since no one could answer:

> >http://groups.google.com/group/v8-users/browse_thread/thread/66b80bca...

Reply all
Reply to author
Forward
0 new messages