Bug 1132252. An interface with an interface object should not inherit from one that's [NoInterfaceObject]. r=smaug

This commit is contained in:
Boris Zbarsky 2015-02-12 18:39:26 -05:00
parent dccefcef01
commit 11f1c43ca5
2 changed files with 14 additions and 6 deletions

View File

@ -687,12 +687,9 @@ def InterfaceObjectProtoGetter(descriptor):
interface prototype as a JS::Handle<JSObject*> or None if no such
function exists.
"""
parentWithInterfaceObject = descriptor.interface.parent
while (parentWithInterfaceObject and
not parentWithInterfaceObject.hasInterfaceObject()):
parentWithInterfaceObject = parentWithInterfaceObject.parent
if parentWithInterfaceObject:
parentIfaceName = parentWithInterfaceObject.identifier.name
parentInterface = descriptor.interface.parent
if parentInterface:
parentIfaceName = parentInterface.identifier.name
parentDesc = descriptor.getDescriptor(parentIfaceName)
prefix = toBindingNamespace(parentDesc.name)
protoGetter = prefix + "::GetConstructorObject"

View File

@ -753,6 +753,17 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
self.parent.identifier.name),
[self.location, self.parent.location])
# Interfaces which have interface objects can't inherit
# from [NoInterfaceObject] interfaces.
if (self.parent.getExtendedAttribute("NoInterfaceObject") and
not self.getExtendedAttribute("NoInterfaceObject")):
raise WebIDLError("Interface %s does not have "
"[NoInterfaceObject] but inherits from "
"interface %s which does" %
(self.identifier.name,
self.parent.identifier.name),
[self.location, self.parent.location])
for iface in self.implementedInterfaces:
iface.finish(scope)