mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 19:38:13 +00:00
Bug 823088 - Add a static assertion that bindings with descriptor.nativeOwnership == 'nsisupports' inherit from nsISupports; r=bz
This commit is contained in:
parent
f96f32cdf5
commit
1e109fdaab
@ -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