[webkit-dev] KJS::JSObject question

Jack Wootton jackwootton at gmail.com
Thu May 14 08:03:37 PDT 2009

Hello all,

I'm looking at the JSObject class in the KJS namespace.  The file is
JavaScriptCore/kjs/object.h.  My understanding of this class is that
it must be subclassed when adding new JavaScript objects to suplement
the standard global objects such as "document" or "window" etc.  I
have a vague understanding of the functions involved when calling a
method or accessing an attribute of a JSObject, for example:

JSValue *get(ExecState *exec, const Identifier &propertyName) const;
bool getPropertySlot(ExecState *, const Identifier&, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);

(Although I don't understand PropertySlots.  perhaps someone can offer
some guidance in that area?)

My question:  I do not understand how JSObject can be used to allow
for the JavaScript syntax of : myNewJSObject.someObject.hello().

So in the example above there are two objects before reaching the
function call.  Any advice on implementing this with WebKit would be


More information about the webkit-dev mailing list