Closed
Bug 764104
Opened 13 years ago
Closed 13 years ago
Compilation fails if C++ keyword used in WebIDL enum.
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: wchen, Assigned: bzbarsky)
Details
Attachments
(1 file)
|
3.79 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
WebIDL enum containing a C++ keyword will generate C++ a enum that contain the keyword, causing compilation to fail.
Example:
enum NotificationPermission {
"default",
"denied",
"granted"
};
taken from (http://dvcs.w3.org/hg/notifications/raw-file/tip/Overview.html#api) will generate:
enum valuelist {
default,
denied,
granted
};
The enum above will fail to compile due to the "default" keyword (at least in clang).
| Assignee | ||
Comment 1•13 years ago
|
||
Yeah, this is a bit of a PITA.
One option is to upcase the first character of each enum value. So we would have:
enum valuelist {
Default,
Denied,
Granted
};
Another is to add more special cases to getEnumValueName (there's already a special case for "", but we could add one for "default").
I vote for upper case.
| Assignee | ||
Comment 3•13 years ago
|
||
Attachment #632504 -
Flags: review?(peterv)
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Updated•13 years ago
|
Attachment #632504 -
Flags: review?(peterv) → review+
| Assignee | ||
Comment 4•13 years ago
|
||
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla16
Comment 5•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•