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

RESOLVED FIXED in mozilla23

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: reuben, Assigned: bz)

Tracking

(Blocks: 1 bug)

Trunk
mozilla23
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
<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
Created 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.
Attachment #732151 - Flags: review?(continuation)
Assignee: nobody → bzbarsky
Created 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.
Attachment #732153 - Flags: review?(continuation)
Blocks: 580070
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.
You need to log in before you can comment on or make changes to this bug.