Bug 972312 part 1. Generate virtual As*Event functions on WebIDL events so that we can easily go from an nsDOMEvent to the relevant event subtype. r=smaug

This commit is contained in:
Boris Zbarsky 2014-02-23 00:01:12 -05:00
parent ec10a1eee2
commit 018e2c3c0d

View File

@ -11992,9 +11992,17 @@ class CGEventClass(CGBindingImplClass):
"parentType": self.parentType
})
CGClass.__init__(self, descriptor.nativeType.split('::')[-1],
className = descriptor.nativeType.split('::')[-1]
asConcreteTypeMethod = ClassMethod("As%s" % className,
"%s*" % className,
[],
virtual=True,
body="return this;",
breakAfterReturnDecl=" ")
CGClass.__init__(self, className,
bases=[ClassBase(self.parentType)],
methods=self.methodDecls,
methods=[asConcreteTypeMethod]+self.methodDecls,
members=members,
extradeclarations=baseDeclarations)