RESOLVED FIXED 115447
Objective-C JavaScriptCore API should publicly support bridging to C
https://bugs.webkit.org/show_bug.cgi?id=115447
Summary Objective-C JavaScriptCore API should publicly support bridging to C
Geoffrey Garen
Reported 2013-04-30 14:37:23 PDT
Objective-C JavaScriptCore API should publicly support bridging to C
Attachments
patch (50.57 KB, patch)
2013-04-30 14:43 PDT, Geoffrey Garen
no flags
Geoffrey Garen
Comment 1 2013-04-30 14:43:16 PDT
Mark Hahnenberg
Comment 2 2013-04-30 14:49:56 PDT
Comment on attachment 200150 [details] patch r=me
Geoffrey Garen
Comment 3 2013-04-30 14:54:41 PDT
Timothy Hatcher
Comment 4 2013-04-30 18:48:19 PDT
Comment on attachment 200150 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=200150&action=review > Source/JavaScriptCore/API/JSContext.h:124 > +// Creates a JSContext, wrapping its C API counterpart. > ++ (JSContext *)contextWithJSGlobalContextRef:(JSGlobalContextRef)jsGlobalContextRef; > +// Returns the C API counterpart wrapped by a JSContext. > +- (JSGlobalContextRef)JSGlobalContextRef; I'm not sure I like these method names. globalContextRef and contextWithGlobalContextRef: are more ObjC-like. > Source/JavaScriptCore/API/JSContext.mm:52 > -- (JSGlobalContextRef)globalContextRef > +- (JSGlobalContextRef)JSGlobalContextRef Keep it like you had before! > Source/JavaScriptCore/API/JSContext.mm:100 > - return [JSValue valueWithValue:result inContext:self]; > + return [JSValue valueWithJSValueRef:result inContext:self]; No…!
Geoffrey Garen
Comment 5 2013-04-30 19:44:03 PDT
Here are the four functions we're considering in context: @interface JSValue(JSValueRefSupport) + (JSValue *)valueWithJSValueRef:(JSValueRef)value inContext:(JSContext *)context; - (JSValueRef)JSValueRef; @end @interface JSContext(JSContextRefSupport) + (JSContext *)contextWithJSGlobalContextRef:(JSGlobalContextRef)jsGlobalContextRef; - (JSGlobalContextRef)JSGlobalContextRef; @end If we switched away from type names for functions, what would we name the up-conversion and down-conversion functions in JSValue?
Mark Hahnenberg
Comment 6 2013-05-14 11:39:48 PDT
Comment on attachment 200150 [details] patch Clearing flags.
Geoffrey Garen
Comment 7 2013-05-14 13:46:07 PDT
We discussed this in IRC and decided to keep the names as-is, since bare words "value" and "context" alone would probably be too terse, to the point of conflicting with things like NSValue and CGContext.
Note You need to log in before you can comment on or make changes to this bug.