mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Remove the return value from DefineDOMInterface.
This moves the assertion from its only caller into the function itself, to clarify that we don't intent to deal with any failure here.
This commit is contained in:
parent
6720b8110a
commit
dc11464933
1 changed files with 3 additions and 3 deletions
|
@ -2123,7 +2123,7 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
"""
|
"""
|
||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
args = [Argument('&mut JSPageInfo', 'js_info')]
|
args = [Argument('&mut JSPageInfo', 'js_info')]
|
||||||
CGAbstractMethod.__init__(self, descriptor, 'DefineDOMInterface', 'bool', args, pub=True)
|
CGAbstractMethod.__init__(self, descriptor, 'DefineDOMInterface', 'void', args, pub=True)
|
||||||
|
|
||||||
def define(self):
|
def define(self):
|
||||||
return CGAbstractMethod.define(self)
|
return CGAbstractMethod.define(self)
|
||||||
|
@ -2180,7 +2180,7 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
return (body + """ let cx = js_info.js_context.deref().ptr;
|
return (body + """ let cx = js_info.js_context.deref().ptr;
|
||||||
let receiver = js_info.js_compartment.global_obj;
|
let receiver = js_info.js_compartment.global_obj;
|
||||||
let global: *JSObject = JS_GetGlobalForObject(cx, receiver);
|
let global: *JSObject = JS_GetGlobalForObject(cx, receiver);
|
||||||
return %s(cx, global, receiver).is_not_null();""" % (getter))
|
assert!(%s(cx, global, receiver).is_not_null());""" % (getter))
|
||||||
|
|
||||||
def needCx(returnType, arguments, extendedAttributes, considerTypes):
|
def needCx(returnType, arguments, extendedAttributes, considerTypes):
|
||||||
return (considerTypes and
|
return (considerTypes and
|
||||||
|
@ -4378,7 +4378,7 @@ class CGRegisterProtos(CGAbstractMethod):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
def _registerProtos(self):
|
def _registerProtos(self):
|
||||||
lines = [" assert!(codegen::%sBinding::DefineDOMInterface(js_info));" % (desc.name)
|
lines = [" codegen::%sBinding::DefineDOMInterface(js_info);" % desc.name
|
||||||
for desc in self.config.getDescriptors(hasInterfaceObject=True,
|
for desc in self.config.getDescriptors(hasInterfaceObject=True,
|
||||||
register=True)]
|
register=True)]
|
||||||
return '\n'.join(lines) + '\n'
|
return '\n'.join(lines) + '\n'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue