WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
73651
[Refactoring] Use join(", ", @arguments) to build a method argument string in CodeGenerator*.pm
https://bugs.webkit.org/show_bug.cgi?id=73651
Summary
[Refactoring] Use join(", ", @arguments) to build a method argument string in...
Kentaro Hara
Reported
2011-12-02 05:52:44 PST
The code in CodeGenerator*.pm to build a method argument string is really dirty and error-prone. It is building an argument string incrementally judging whether ", " is necessary or not, like this: my $method = ... ? "func(" : "func(a"; if (...) { $method .= $method =~ /\($/ ? "b" : ", b"; } $method .= ")"; Alternatively, we can refactor the code as follows: my $funcName = "func"; my @arguments; push(@arguments, "a") if (...); push(@arguments, "b") if (...); my $method = $funcName . "(" . join(", ", @arguments) . ")";
Attachments
check if all builds succeed
(30.95 KB, patch)
2011-12-02 06:19 PST
,
Kentaro Hara
no flags
Details
Formatted Diff
Diff
Patch
(30.95 KB, patch)
2011-12-02 17:46 PST
,
Kentaro Hara
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Kentaro Hara
Comment 1
2011-12-02 06:19:46 PST
Created
attachment 117616
[details]
check if all builds succeed
Kentaro Hara
Comment 2
2011-12-02 17:46:50 PST
Created
attachment 117719
[details]
Patch
WebKit Review Bot
Comment 3
2011-12-02 23:22:27 PST
Comment on
attachment 117719
[details]
Patch Clearing flags on attachment: 117719 Committed
r101914
: <
http://trac.webkit.org/changeset/101914
>
WebKit Review Bot
Comment 4
2011-12-02 23:22:31 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug