Closed
Bug 841429
Opened 12 years ago
Closed 12 years ago
passing optional integer arguments with default values in callback interface generates invalid code
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: mccr8, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
callback interface Foo {
void passOptionalByteWithDefault(optional byte arg = 0);
};
generates code like:
if (arg.WasPassed()) {
argv[0] = INT_TO_JSVAL(int32_t(arg.Value()));
break;
where arg is int8_t
![]() |
Assignee | |
Updated•12 years ago
|
Blocks: ParisBindings
Reporter | ||
Comment 1•12 years ago
|
||
As you may guess, this also applies to the other integer types.
Summary: passing optional byte with default argument in callback interface generates invalid code → passing optional integer arguments with default values in callback interface generates invalid code
Reporter | ||
Comment 2•12 years ago
|
||
Also for at least one non-integer pattern this fails:
callback interface Foo {
void passOptionalSelfWithDefault(optional Foo? arg = null);
};
with errors like:
/Users/amccreight/mz/cent/obj-dbg/dom/bindings/JSImplBinding.cpp:35:12: error: member reference type 'mozilla::dom::Foo *' is a pointer; maybe you meant to use '->'?
if (arg.WasPassed()) {
~~~^
->
/Users/amccreight/mz/cent/obj-dbg/dom/bindings/JSImplBinding.cpp:35:13: error: no member named 'WasPassed' in 'mozilla::dom::Foo'
if (arg.WasPassed()) {
~~~ ^
Presumably basically the same thing...
![]() |
Assignee | |
Comment 3•12 years ago
|
||
Attachment #731386 -
Flags: review?(continuation)
![]() |
Assignee | |
Updated•12 years ago
|
Assignee: nobody → bzbarsky
![]() |
Assignee | |
Updated•12 years ago
|
Whiteboard: [need review]
Reporter | ||
Updated•12 years ago
|
Attachment #731386 -
Flags: review?(continuation) → review+
![]() |
Assignee | |
Comment 4•12 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla23
Comment 5•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 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
•