"It would be useful if there was a +[JSContext currentObject] API which was callable from ObjC API callbacks. Its purpose would be to allow convenient access to the JSValue wrapper for the currently-executing block callback."
<rdar://problem/15180594>
Created attachment 213933 [details] Patch
Comment on attachment 213933 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=213933&action=review > Source/JavaScriptCore/API/JSContext.h:72 > ++ (JSValue *)currentCallee; Don’t we need to put availability macros on new methods that were not always in older versions of this API?
Created attachment 214305 [details] availability macro hacks
Attachment 214305 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSContext.h', u'Source/JavaScriptCore/API/JSContext.mm', u'Source/JavaScriptCore/API/JSContextInternal.h', u'Source/JavaScriptCore/API/ObjCCallbackFunction.mm', u'Source/JavaScriptCore/API/WebKitAvailability.h', u'Source/JavaScriptCore/API/tests/testapi.mm', u'Source/JavaScriptCore/ChangeLog']" exit_code: 1 Source/JavaScriptCore/API/WebKitAvailability.h:52: Missing spaces around = [whitespace/operators] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 214308 [details] more availability macro hacks
Attachment 214308 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSContext.h', u'Source/JavaScriptCore/API/JSContext.mm', u'Source/JavaScriptCore/API/JSContextInternal.h', u'Source/JavaScriptCore/API/ObjCCallbackFunction.mm', u'Source/JavaScriptCore/API/WebKitAvailability.h', u'Source/JavaScriptCore/API/tests/testapi.mm', u'Source/JavaScriptCore/ChangeLog']" exit_code: 1 Source/JavaScriptCore/API/WebKitAvailability.h:52: Missing spaces around = [whitespace/operators] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 214308 [details] more availability macro hacks Attachment 214308 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/4107054
Created attachment 214315 [details] trying to build
Attachment 214315 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSContext.h', u'Source/JavaScriptCore/API/JSContext.mm', u'Source/JavaScriptCore/API/JSContextInternal.h', u'Source/JavaScriptCore/API/ObjCCallbackFunction.mm', u'Source/JavaScriptCore/API/WebKitAvailability.h', u'Source/JavaScriptCore/API/tests/testapi.mm', u'Source/JavaScriptCore/ChangeLog']" exit_code: 1 Source/JavaScriptCore/API/WebKitAvailability.h:52: Missing spaces around = [whitespace/operators] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 214317 [details] whyunobuild
Attachment 214317 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/API/JSContext.h', u'Source/JavaScriptCore/API/JSContext.mm', u'Source/JavaScriptCore/API/JSContextInternal.h', u'Source/JavaScriptCore/API/ObjCCallbackFunction.mm', u'Source/JavaScriptCore/API/WebKitAvailability.h', u'Source/JavaScriptCore/API/tests/testapi.mm', u'Source/JavaScriptCore/ChangeLog']" exit_code: 1 Source/JavaScriptCore/API/WebKitAvailability.h:52: Missing spaces around = [whitespace/operators] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 214317 [details] whyunobuild Attachment 214317 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/3482132
Comment on attachment 214317 [details] whyunobuild Attachment 214317 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/4110069
Created attachment 223403 [details] Patch
Attachment 223403 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/JSContext.h:108: Missing space after , [whitespace/comma] [3] ERROR: Source/JavaScriptCore/API/JSContext.h:110: Missing space after , [whitespace/comma] [3] Total errors found: 2 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 223403 [details] Patch r=me
Comment on attachment 223403 [details] Patch Needs some macro magic for iOS stuff.
Committed r163590: <http://trac.webkit.org/changeset/163590>