WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
122239
IDL parser should remove a leading "_" from identifier names
https://bugs.webkit.org/show_bug.cgi?id=122239
Summary
IDL parser should remove a leading "_" from identifier names
Eric Carlson
Reported
2013-10-02 14:02:37 PDT
According the the WebIDL spec [1]: ... the identifier is the value of the identifier token with any single leading U+005F LOW LINE ("_") character (underscore) removed. Note A leading "_" is used to escape an identifier from looking like a reserved word so that, for example, an interface named “interface” can be defined. The leading "_" is dropped to unescape the identifier.
http://www.w3.org/TR/WebIDL/#idl-names
Attachments
Proposed patch
(28.30 KB, patch)
2013-10-02 14:14 PDT
,
Eric Carlson
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Eric Carlson
Comment 1
2013-10-02 14:14:05 PDT
Created
attachment 213198
[details]
Proposed patch
WebKit Commit Bot
Comment 2
2013-10-02 14:16:43 PDT
Attachment 213198
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/bindings/scripts/IDLParser.pm', u'Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp', u'Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h', u'Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp', u'Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h', u'Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.symbols', u'Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp', u'Source/WebCore/bindings/scripts/test/JS/JSTestObj.h', u'Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h', u'Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm', u'Source/WebCore/bindings/scripts/test/TestException.idl', u'Source/WebCore/bindings/scripts/test/TestInterface.idl', u'Source/WebCore/bindings/scripts/test/TestObj.idl']" exit_code: 1 Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h:63: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h:68: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h:212: The parameter name "a" adds no information, so it should be removed. [readability/parameter_name] [5] Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp:213: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 4 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jer Noble
Comment 3
2013-10-02 14:45:44 PDT
Comment on
attachment 213198
[details]
Proposed patch 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/^\_//;
Eric Carlson
Comment 4
2013-10-02 16:32:27 PDT
Committed
r156808
:
https://trac.webkit.org/r156808
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