mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 823088 - Add a static assertion that bindings with descriptor.nativeOwnership == 'nsisupports' inherit from nsISupports; r=bz
This commit is contained in:
parent
e1d87b9f1f
commit
213ae1202e
@ -753,9 +753,14 @@ class CGAbstractClassHook(CGAbstractStaticMethod):
|
||||
args)
|
||||
|
||||
def definition_body_prologue(self):
|
||||
return """
|
||||
if self.descriptor.nativeOwnership == 'nsisupports':
|
||||
assertion = (' MOZ_STATIC_ASSERT((IsBaseOf<nsISupports, %s>::value), '
|
||||
'"Must be an nsISupports class");') % self.descriptor.nativeType
|
||||
else:
|
||||
assertion = ''
|
||||
return """%s
|
||||
%s* self = UnwrapDOMObject<%s>(obj);
|
||||
""" % (self.descriptor.nativeType, self.descriptor.nativeType)
|
||||
""" % (assertion, self.descriptor.nativeType, self.descriptor.nativeType)
|
||||
|
||||
def definition_body(self):
|
||||
return self.definition_body_prologue() + self.generate_code()
|
||||
|
Loading…
Reference in New Issue
Block a user