Closed Bug 963388 Opened 10 years ago Closed 10 years ago

Add support for nullable dictionary return values in callback and js-implemented codegen

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Bug 886110 looks like it'll need it, right Blake?
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Whiteboard: [need review]
Comment on attachment 8364822 [details] [diff] [review]
Add support for nullable dictionary return values in callbacks and js-implemented bindings.

Review of attachment 8364822 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/Codegen.py
@@ +3870,5 @@
>  
> +        if type.nullable():
> +            dictLoc = "${declName}.SetValue()"
> +        else:
> +            dictLoc = "${declName}"

I'd do:

        dictLoc = "${declName}"
        if type.nullable():
            dictLoc += ".SetValue()"

@@ +3878,5 @@
>                              exceptionCodeIndented.define()))
>  
> +        if type.nullable():
> +            declType = CGTemplatedType("Nullable", declType)
> +            # XXXbz Should this check be isNullOrUndefined() instead?

Given that the conversion from ECMAScript type to WebIDL type would work like that, I'd say yes.
Attachment #8364822 - Flags: review?(peterv) → review+
Made those changes and pushed: https://hg.mozilla.org/integration/mozilla-inbound/rev/bbde82f0d314
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla30
https://hg.mozilla.org/mozilla-central/rev/bbde82f0d314
Status: ASSIGNED → RESOLVED
Closed: 10 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.

Attachment

General

Created:
Updated:
Size: