Closed Bug 843355 Opened 12 years ago Closed 12 years ago

optional enum arguments don't work for callback interfaces

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 863386

People

(Reporter: mccr8, Unassigned)

References

(Blocks 1 open bug)

Details

enum MyTestEnum { "a", "b" }; callback interface Foo { void passOptionalEnum(optional MyTestEnum arg); }; Seems vaguely similar to bug 841429. The problem seems to be declaring a variable |arg.Value()_str|, which is just bogus. JSString* arg.Value()_str = JS_NewStringCopyN(cx, MyTestEnumValues::strings[uint32_t(arg.Value())].value, MyTestEnumValues::strings[uint32_t(arg.Value())].length); ^ ; /Users/amccreight/mz/cent/obj-dbg/dom/bindings/JSImplBinding.cpp:48:15: error: member reference type 'JSString *' is a pointer; maybe you meant to use '->'? if (!arg.Value()_str) { ~~~^ -> /Users/amccreight/mz/cent/obj-dbg/dom/bindings/JSImplBinding.cpp:48:15: error: incomplete definition of type 'JSString' if (!arg.Value()_str) { ~~~^ ../../dist/include/jspubtd.h:191:45: note: forward declaration of 'JSString' class JSString; ^ /Users/amccreight/mz/cent/obj-dbg/dom/bindings/JSImplBinding.cpp:52:36: error: member reference type 'JSString *' is a pointer; maybe you meant to use '->'? argv[0] = JS::StringValue(arg.Value()_str); ~~~^ -> /Users/amccreight/mz/cent/obj-dbg/dom/bindings/JSImplBinding.cpp:52:36: error: incomplete definition of type 'JSString' argv[0] = JS::StringValue(arg.Value()_str); ~~~^ ../../dist/include/jspubtd.h:191:45: note: forward declaration of 'JSString' class JSString; ^ 5 errors generated.
Depends on: 863386
Status: NEW → RESOLVED
Closed: 12 years ago
No longer depends on: 863386
Flags: in-testsuite+
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.