On Tue, Mar 13, 2012 at 2:26 PM, avasilev <[email protected]> wrote:
> Hello,
> Is there a way to get a function's prototype, equivalent to the
> function's 'prototype' property, e.g.:
>
> function Func()
> {}
> var a = Func.prototype;
>
> Using Object::GetPrototype() does not do the same and returns a
> different value. Setting an object's prototype via SetPrototype() to
> the property value gives the desired effect of instanceof recognizing
> the object as constructed by the function. Setting the prototype to
> the function's GetPrototype() does not achieve this.
> From the doc I don't see a way to access the "prototype" property of a
> function, besides getting it as an ordinary property via  func-
>>Get(String::New("prototype"));
> Am I missing something?

I don't think you are. Why should there be another way, apart from
convenience? If JS specifies it as a property, especially not even a
special one, then use the property accessor. You may of course argue
that it's inconsistent with, say, Array::Length.

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

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

Reply via email to