Bug 128542 - Make the Identifier::add() family return PassRef<StringImpl>.
Summary: Make the Identifier::add() family return PassRef<StringImpl>.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-10 10:27 PST by Andreas Kling
Modified: 2014-02-10 12:34 PST (History)
1 user (show)

See Also:


Attachments
Patch (8.55 KB, patch)
2014-02-10 10:28 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.