[webkit-dev] prototypes and host objects

Darin Adler darin at apple.com
Wed Feb 10 08:33:56 PST 2010


This is a question for webkit-help, not webkit-dev. The webkit-dev mailing list is for discussion of development of WebKit, not for use of WebKit.

See <http://webkit.org/contact.html> for this.

I can’t resist answering this one, though. Next time I will not answer this kind of question on this mailing list.

On Feb 10, 2010, at 6:58 AM, Allison Newman wrote:

> host_object.prototype resolves as [undefined].

This is one of the curious things about JavaScript language. The property named “prototype” does not return the prototype of an object. Instead it is the prototype for use when using that object as a constructor with the new operator. The “prototype” property a plain old property like any other, and if you want to set it up you can do it in your JSClassDefinition just like other properties.

The syntax host_object.__proto__ will give you the prototype of host_object.

    -- Darin



More information about the webkit-dev mailing list