Closed Bug 856819 Opened 11 years ago Closed 11 years ago

Can't declare a JS-implemented iface that inherits from another JS-implemented iface declared in the same webidl file if their order happens to be wrong

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: reuben, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

<bz> So we can fix this in the codegen
<bz> we have something like that already for dictionaries
<bz> I mean, it's not compiling because C++ cares about ordering
<bz> and wants to see superclass decls before subclasses.  ;)
Summary: Can't declare a JS-implemented iface that inherits from another JS-implemented iface declared in the same webidl file → Can't declare a JS-implemented iface that inherits from another JS-implemented iface declared in the same webidl file if their order happens to be wrong
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment on attachment 732151 [details] [diff] [review]
part 1.  Refactor the dependency-sorting we do for dictionaries so that we can also use it for JS-implemented interfaces.

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

::: dom/bindings/Codegen.py
@@ +7138,5 @@
> +    dependencyGetter is something that, given an object, should return
> +    the set of objects it depends on.
> +    """
> +    # XXXbz this will fail if we have two webidl files F1 and F2 such that F1
> +    # declares an object which depends on an object in F2 and F2 declares an

Would you mind changing this to "in F2, and F2"?  My mind wants to put "F2 and F2" together. (That's a little accidental pun for you...)
Attachment #732151 - Flags: review?(continuation) → review+
Comment on attachment 732153 [details] [diff] [review]
part 2.  Sort js-implemented interfaces in a given file so that the declarations in C++ come in the right order.

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

::: dom/bindings/test/TestJSImplInheritanceGen.webidl
@@ +11,5 @@
>  [Constructor, JSImplementation="@mozilla.org/test-js-impl-interface3;1"]
>  interface TestJSImplInterface3 : TestCImplementedInterface2 {
>  };
>  
> +// Important: TestJSImplInterface5 needs to come before TestJSImplInterface6 to test what it's trying to test.

Maybe for these comments specify "before TestJSImplInterface6 in the file" and likewise for the other one?
Attachment #732153 - Flags: review?(continuation) → review+
> Would you mind changing this to "in F2, and F2"? 

Done.

> Maybe for these comments specify "before TestJSImplInterface6 in the file"

Done.
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: