Bug 731746 part 3. Change JS-implemented webidl codegen to always invoke the parent constructor if there is a parent interface. r=mccr8

This commit is contained in:
Boris Zbarsky 2013-04-24 22:44:28 -04:00
parent 2f17e61fc4
commit de9b7862dc
2 changed files with 8 additions and 3 deletions

View File

@ -8433,11 +8433,14 @@ class CGJSImplClass(CGBindingImplClass):
parentInterface = descriptor.interface.parent
while parentInterface:
if parentInterface.isJSImplemented():
baseConstructors = (
[ "%s(aJSImplObject, aParent)" % parentClass ] +
baseConstructors )
baseConstructors.insert(
0, "%s(aJSImplObject, aParent)" % parentClass )
break
parentInterface = parentInterface.parent
if not parentInterface and descriptor.interface.parent:
# We only have C++ ancestors, so only pass along the window
baseConstructors.insert(0,
"%s(aParent)" % parentClass)
constructor = ClassConstructor(
[Argument("JSObject*", "aJSImplObject"),

View File

@ -26,6 +26,8 @@ class TestCImplementedInterface2 : public nsISupports,
public nsWrapperCache
{
public:
TestCImplementedInterface2(nsPIDOMWindow* aParent)
{}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestCImplementedInterface2)