NEW 21461
JavaScriptCore C API Enhancements (For wrapping type systems)
https://bugs.webkit.org/show_bug.cgi?id=21461
Summary JavaScriptCore C API Enhancements (For wrapping type systems)
Robert Carr
Reported 2008-10-07 22:12:07 PDT
The current JavaScriptCore C API has several inadequacies and awkward points making the dynamic wrapping of type systems (such as GObject, or the Objective-C type system) difficult. A few of these are outlined as follows, however I am not sure I have identified them all, or in any way provided best solutions. - When wrapping an object in the foreign type system, it is difficult to use static functions. One of these issues, is there is no opportunity to provide private data to the function (So that in your callback, you can identify which function in the foreign type system has been called.). An obvious solution would be an extension to the JSStaticFunction struct. Furthermore, (presumably for optimization purposes). Another issue is the name member of the JSStaticFunction struct is declared "const char * const", which obviously has some awkwardness in creating them from non string literals. - If not able to use the static function API, you have to manually manage prototypes to add functions to a class you are creating. However this is awkward to use, and two things would make this easier: JSClassDefinition allowing you to specify the prototype to use when not using automatic prototypes. Something should allow you to get the prototype a JSClassRef will use without instantiating an object.
Attachments
Mark Rowe (bdash)
Comment 1 2008-10-07 23:46:24 PDT
Note You need to log in before you can comment on or make changes to this bug.