[webkit-reviews] review granted: [Bug 122239] IDL parser should remove a leading "_" from identifier names : [Attachment 213198] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 2 14:46:48 PDT 2013


Jer Noble <jer.noble at apple.com> has granted Eric Carlson
<eric.carlson at apple.com>'s request for review:
Bug 122239: IDL parser should remove a leading "_" from identifier names
https://bugs.webkit.org/show_bug.cgi?id=122239

Attachment 213198: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=213198&action=review

------- Additional Comments from Jer Noble <jer.noble at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=213198&action=review


> Source/WebCore/bindings/scripts/IDLParser.pm:318
> +sub identifierRemoveNullablePrefix
> +{
> +    my $type = shift;
> +    $type =~ s/\_// if $type =~ /^\_/;
> +    return $type;
> +}
> +

A regexp seems heavy handed here.  How about just:

my $type = shift;
return substr($type, 0, 1) == "_" ? substr($type, 1) : $type;

If you want to leave in the regexp, we should just do:

my $type = shift;
return $type =~ s/^\_//;


More information about the webkit-reviews mailing list