Bug 128542

Summary: Make the Identifier::add() family return PassRef<StringImpl>.
Product: WebKit Reporter: Andreas Kling <kling>
Component: JavaScriptCoreAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Andreas Kling 2014-02-10 10:27:49 PST
We should make Identifier::add() and friends return PassRef<StringImpl> since they are guaranteed to return non-null strings.
This will remove one null-check branch from Identifier's constructor.
Comment 1 Andreas Kling 2014-02-10 10:28:21 PST
Created attachment 223724 [details]
Patch
Comment 2 WebKit Commit Bot 2014-02-10 10:29:40 PST
Attachment 223724 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/Identifier.h:133:  The parameter name "r" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/Identifier.h:134:  The parameter name "r" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Antti Koivisto 2014-02-10 11:31:37 PST
Comment on attachment 223724 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=223724&action=review

> Source/JavaScriptCore/runtime/Identifier.h:196
> +        return addResult.isNewEntry ? adoptRef(**addResult.iterator) : **addResult.iterator;

** :|
Comment 4 WebKit Commit Bot 2014-02-10 12:34:12 PST
Comment on attachment 223724 [details]
Patch

Clearing flags on attachment: 223724

Committed r163808: <http://trac.webkit.org/changeset/163808>
Comment 5 WebKit Commit Bot 2014-02-10 12:34:14 PST
All reviewed patches have been landed.  Closing bug.