Bug 125141 - [Mac] Modernize the JavaScriptCore API headers
Summary: [Mac] Modernize the JavaScriptCore API headers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Rowe (bdash)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-12-03 02:02 PST by Mark Rowe (bdash)
Modified: 2013-12-11 14:10 PST (History)
2 users (show)

See Also:


Attachments
Patch (11.28 KB, patch)
2013-12-03 02:04 PST, Mark Rowe (bdash)
no flags Details | Formatted Diff | Diff
Patch (10.06 KB, patch)
2013-12-11 01:01 PST, Mark Rowe (bdash)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rowe (bdash) 2013-12-03 02:02:55 PST
The JavaScriptCore API headers contain some legacy constructs that could be modernized while preserving binary compatibility. We should do that!

<rdar://problem/15540121>
Comment 1 Mark Rowe (bdash) 2013-12-03 02:04:30 PST
Created attachment 218279 [details]
Patch
Comment 2 WebKit Commit Bot 2013-12-03 02:06:28 PST
Attachment 218279 [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/JSManagedValue.h', u'Source/JavaScriptCore/API/JSManagedValue.mm', u'Source/JavaScriptCore/API/JSStringRefCF.h', u'Source/JavaScriptCore/API/JSValue.h', u'Source/JavaScriptCore/API/JSVirtualMachine.h', u'Source/JavaScriptCore/API/JSVirtualMachine.mm', u'Source/JavaScriptCore/ChangeLog']" exit_code: 1
ERROR: Source/JavaScriptCore/API/JSStringRefCF.h:54:  The parameter name "alloc" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/API/JSStringRefCF.h:54:  The parameter name "string" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/API/JSValue.h:383:  Missing spaces around =  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/API/JSValue.h:389:  Missing spaces around =  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/API/JSValue.h:395:  Missing spaces around =  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/API/JSValue.h:404:  Missing spaces around =  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/API/JSValue.h:410:  Missing spaces around =  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/API/JSValue.h:416:  Missing spaces around =  [whitespace/operators] [4]
Total errors found: 8 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2013-12-03 15:14:52 PST
This class of naming looks strange to me:

@property (getter=isNumber, readonly) BOOL number;

I think of that property as "isNumber", and not "number".
Comment 4 Mark Rowe (bdash) 2013-12-03 16:33:46 PST
That's the naming convention for properties per <https://developer.apple.com/library/mac/documentation/cocoa/conceptual/codingguidelines/Articles/NamingIvarsAndTypes.html>.

I've reached out to some folks internally for guidance on this since it does lead to some awkward constructs (value.number returning a BOOL, for instance). I'll hold off on landing this for now.
Comment 5 Mark Rowe (bdash) 2013-12-11 01:01:58 PST
Created attachment 218937 [details]
Patch
Comment 6 Mark Rowe (bdash) 2013-12-11 01:02:47 PST
The feedback that I received that in this case following the convention is too confusing, so I'm leaving the isFoo methods as simple getters.
Comment 7 WebKit Commit Bot 2013-12-11 01:03:53 PST
Attachment 218937 [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/JSManagedValue.h', u'Source/JavaScriptCore/API/JSManagedValue.mm', u'Source/JavaScriptCore/API/JSStringRefCF.h', u'Source/JavaScriptCore/API/JSValue.h', u'Source/JavaScriptCore/API/JSVirtualMachine.h', u'Source/JavaScriptCore/API/JSVirtualMachine.mm', u'Source/JavaScriptCore/ChangeLog', '--commit-queue']" exit_code: 1
ERROR: Source/JavaScriptCore/API/JSStringRefCF.h:54:  The parameter name "alloc" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/API/JSStringRefCF.h:54:  The parameter name "string" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 WebKit Commit Bot 2013-12-11 14:10:21 PST
Comment on attachment 218937 [details]
Patch

Clearing flags on attachment: 218937

Committed r160454: <http://trac.webkit.org/changeset/160454>
Comment 9 WebKit Commit Bot 2013-12-11 14:10:28 PST
All reviewed patches have been landed.  Closing bug.