Allow using union members in codegenerated events

RESOLVED FIXED in Firefox 28, Firefox OS v1.3

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

(Blocks: 1 bug)

unspecified
mozilla29
x86
Mac OS X
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking-b2g:1.3+, firefox27 wontfix, firefox28 fixed, firefox29 fixed, b2g-v1.3 fixed, b2g-v1.4 fixed)

Details

Attachments

(3 attachments)

Andrea needs it, and anyway it's good to have it working.
Created attachment 8346270 [details] [diff] [review]
part 1.  Share more codegen between events and CGNativeMember.
Attachment #8346270 - Flags: review?(bugs)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Created attachment 8346273 [details] [diff] [review]
part 2.  Support union members in generated events.
Attachment #8346273 - Flags: review?(bugs)
Comment on attachment 8346270 [details] [diff] [review]
part 1.  Share more codegen between events and CGNativeMember.

But please file a bug to make codegen to use sane coding style for
params. (aFoo, not foo)
Attachment #8346270 - Flags: review?(bugs) → review+
Created attachment 8346584 [details] [diff] [review]
part 3.  Use aRetVal for the outparam return value for CGNativeMember.
Attachment #8346584 - Flags: review?(bugs)
Attachment #8346584 - Flags: review?(bugs) → review+
Comment on attachment 8346273 [details] [diff] [review]
part 2.  Support union members in generated events.


>             if nullable:
>                 dictType = CGTemplatedType("Nullable", dictType)
>             args.append(Argument("%s&" % dictType.define(), "retval"))
>+        elif returnType.isUnion():
>+            args.append(Argument("%s&" %
>+                                 CGUnionStruct.unionTypeDecl(returnType, True),
>+                                 "retval"))
aRetVal

>+        if type.isUnion():
>+            return "retval = " + memberName + ";"
And then change this too.

>+                elif typeNeedsRooting(m.type):
>+                    raise TypeError("Need to implement tracing for event "
>+                                    "member of type %s" % m.type)

OK, this can be done later if needed.
Attachment #8346273 - Flags: review?(bugs) → review+
> aRetVal

That's done in part 3.

> OK, this can be done later if needed.

Indeed.  I just wanted the codegen to scream and die if the case ever comes up, rather than silently not tracing.
Hi

This bug blocks a blocker for v1.3 (Bug 946316). Because of this, nominating this bug for v1.3. Thanks!
blocking-b2g: --- → 1.3?

Updated

5 years ago
status-b2g-v1.3: --- → affected
blocking-b2g: 1.3? → 1.3+
https://hg.mozilla.org/releases/mozilla-aurora/rev/5ee1b0c4fc42
https://hg.mozilla.org/releases/mozilla-aurora/rev/bdd7de70155c
https://hg.mozilla.org/releases/mozilla-aurora/rev/a224f09028ea
status-b2g-v1.3: affected → fixed
status-b2g-v1.4: --- → fixed
status-firefox27: --- → wontfix
status-firefox28: --- → fixed
status-firefox29: --- → fixed
You need to log in before you can comment on or make changes to this bug.