Bug 122621

Summary: +[JSContext currentCallee] should return the currently executing JS function
Product: WebKit Reporter: Mark Hahnenberg <mhahnenberg>
Component: JavaScriptCoreAssignee: Mark Hahnenberg <mhahnenberg>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
availability macro hacks
none
more availability macro hacks
none
trying to build
none
whyunobuild
none
Patch ggaren: review+

Description Mark Hahnenberg 2013-10-10 13:48:30 PDT
"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."
Comment 1 Mark Hahnenberg 2013-10-10 13:48:47 PDT
<rdar://problem/15180594>
Comment 2 Mark Hahnenberg 2013-10-10 15:21:50 PDT
Created attachment 213933 [details]
Patch
Comment 3 Darin Adler 2013-10-10 22:44:02 PDT
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?
Comment 4 Mark Hahnenberg 2013-10-15 14:56:09 PDT
Created attachment 214305 [details]
availability macro hacks
Comment 5 WebKit Commit Bot 2013-10-15 14:57:07 PDT
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.
Comment 6 Mark Hahnenberg 2013-10-15 15:19:01 PDT
Created attachment 214308 [details]
more availability macro hacks
Comment 7 WebKit Commit Bot 2013-10-15 15:20:26 PDT
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 8 Build Bot 2013-10-15 15:48:34 PDT
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
Comment 9 Mark Hahnenberg 2013-10-15 16:03:48 PDT
Created attachment 214315 [details]
trying to build
Comment 10 WebKit Commit Bot 2013-10-15 16:04:57 PDT
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.
Comment 11 Mark Hahnenberg 2013-10-15 16:23:38 PDT
Created attachment 214317 [details]
whyunobuild
Comment 12 WebKit Commit Bot 2013-10-15 16:24:37 PDT
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 13 Build Bot 2013-10-15 16:54:26 PDT
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 14 Build Bot 2013-10-15 17:08:20 PDT
Comment on attachment 214317 [details]
whyunobuild

Attachment 214317 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4110069
Comment 15 Mark Hahnenberg 2014-02-06 16:36:13 PST
Created attachment 223403 [details]
Patch
Comment 16 WebKit Commit Bot 2014-02-06 16:37:27 PST
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 17 Geoffrey Garen 2014-02-06 16:51:37 PST
Comment on attachment 223403 [details]
Patch

r=me
Comment 18 Mark Hahnenberg 2014-02-06 17:18:19 PST
Comment on attachment 223403 [details]
Patch

Needs some macro magic for iOS stuff.
Comment 19 Mark Hahnenberg 2014-02-06 17:51:54 PST
Committed r163590: <http://trac.webkit.org/changeset/163590>