Closed Bug 764398 Opened 13 years ago Closed 13 years ago

Implement enum as dictionary member for WebIDL

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: wchen, Unassigned)

References

Details

Code generation fails if we have an enum type as a dictionary member. Example (from http://dvcs.w3.org/hg/notifications/raw-file/tip/Overview.html#api): dictionary NotificationOptions { NotificationDirection titleDir; DOMString body; NotificationDirection bodyDir; DOMString tag; DOMString iconUrl; }; enum NotificationDirection { "auto", "ltr", "rtl" };
The actual error William is seeing: File "/Users/wchen/mozilla/dom/bindings/Codegen.py", line 1704, in getJSToNativeConversionTemplate if type.isAny(): File "/Users/wchen/mozilla/dom/bindings/parser/WebIDL.py", line 778, in isAny return self.tag() == IDLType.Tags.any File "/Users/wchen/mozilla/dom/bindings/parser/WebIDL.py", line 791, in tag assert False # Override me! This is due to dictionaries not calling complete() on their member types, which causes the type here to be an IDLUnresolvedType instead of an IDLWrapperType for a dictionary. The patch in bug 763911 fixes that, and in my tree with that patch this works.
Depends on: 763911
er, I meant IDLWrapperType for an enum.
Is this fixed? If so, should this be a dupe of bug 763911?
Yeah, this is fixed. We have a test for this in TestCodeGen.webidl.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.