On Tue, Jun 1, 2010 at 11:40 PM, vlad vladbph <[email protected]> wrote:

> As I said it is artificial example :) The key is how original object is
> created...
>
> I need an object that can be called as a function and at the same time have
> properties which I can set getters for... I didn't find the way doing
> so besides:
>

looking over the API, i _think_ you might be able to do the following:

- Create a Function instead of an Object, using FunctionTemplate::New(func).
We'll call that funcTmpl.
- Use funcTmpl->InstanceTemplate() or PrototypeTemplate() (not sure which)
to get an ObjectTemplate, which you can then (theoretically) apply the
accessors to.
- Instantiate that function using funcTmpl->GetFunction(), or possibly
InstanceTemplate()->NewInstance(). (???)

(Warning: i am largely speculating here - the API docs are fairly lean.)

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

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

Reply via email to