[Webkit-unassigned] [Bug 37921] API to get object class name missing from JSC

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 21 09:24:38 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=37921





--- Comment #4 from Kartikaya Gupta <lists.bugzilla at stakface.com>  2010-04-21 09:24:38 PST ---
The reason I would like it added is that I would like to be able to determine
if a JSObjectRef represents a W3C DOM object. There doesn't seem to be any way
to do this with the current API, so my solution was to add the
JSObjectGetClassName and compare the class name to known strings (e.g.
"HTMLDocument"). If there is a better way to do this I'm open to suggestions.

Also I'm not convinced that this is a JavaScriptCore-internal concept as the
ECMA-262 specification does describe the [[Class]] property, which is what this
is getting. In the general case the class is obtainable by calling .toString()
on the object but that doesn't always work (if toString() has been overridden)
and requires parsing on the returned string to extract the class name.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list