Since JSValueRef and JSObjectRef are typedef's to the same OpaqueJSValue structure (pointer), it appears you could almost use them in the same contexts. And if fact, it appears you can use a JSObjectRef wherever a JSValueRef is defined in the API. And you can sometimes use a JSValueRef wherever a JSObjectRef is defined.

It would be nice to see this documented a little better. My current guess is that if JSValueGetType() returns kJSTypeObject for a JSValueRef, you can safely treat it as a JSObjectRef. If it doesn't, then you can't.

Guess is based on looking at the code, seeing the pointer dereferenced in the JSObjectRef cases, but knowing that those pointers are actually sometimes tagged pointers for literal values, in which case the dereference won't work.

--
Patrick Mueller

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to