mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Keep calling the DefineDOMInterface method for NoInterfaceObject interfaces.
DefineDOMInterface also creates the proxy handler for proxy classes, so it should be called in this case as well.
This commit is contained in:
parent
5acbea5199
commit
8df0f981fe
1 changed files with 7 additions and 12 deletions
|
@ -2001,13 +2001,6 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
return CGAbstractMethod.define(self)
|
return CGAbstractMethod.define(self)
|
||||||
|
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
if self.descriptor.interface.hasInterfacePrototypeObject():
|
|
||||||
# We depend on GetProtoObject defining an interface constructor
|
|
||||||
# object as needed.
|
|
||||||
getter = "GetProtoObject"
|
|
||||||
else:
|
|
||||||
getter = "GetConstructorObject"
|
|
||||||
|
|
||||||
body = ""
|
body = ""
|
||||||
#XXXjdm This self.descriptor.concrete check shouldn't be necessary
|
#XXXjdm This self.descriptor.concrete check shouldn't be necessary
|
||||||
if not self.descriptor.concrete or self.descriptor.proxy:
|
if not self.descriptor.concrete or self.descriptor.proxy:
|
||||||
|
@ -2049,10 +2042,13 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
TRACE_HOOK_NAME,
|
TRACE_HOOK_NAME,
|
||||||
self.descriptor.name)
|
self.descriptor.name)
|
||||||
|
|
||||||
return (body + """ let cx = (**js_info.js_context).ptr;
|
if self.descriptor.interface.hasInterfaceObject():
|
||||||
|
body += """ let cx = (**js_info.js_context).ptr;
|
||||||
let global = window.reflector().get_jsobject();
|
let global = window.reflector().get_jsobject();
|
||||||
assert!(global.is_not_null());
|
assert!(global.is_not_null());
|
||||||
assert!(%s(cx, global, global).is_not_null());""" % (getter))
|
assert!(GetProtoObject(cx, global, global).is_not_null());"""
|
||||||
|
|
||||||
|
return body
|
||||||
|
|
||||||
def needCx(returnType, arguments, extendedAttributes, considerTypes):
|
def needCx(returnType, arguments, extendedAttributes, considerTypes):
|
||||||
return (considerTypes and
|
return (considerTypes and
|
||||||
|
@ -3867,8 +3863,7 @@ class CGDescriptor(CGThing):
|
||||||
CGConstant(m for m in descriptor.interface.members if m.isConst()),
|
CGConstant(m for m in descriptor.interface.members if m.isConst()),
|
||||||
public=True))
|
public=True))
|
||||||
|
|
||||||
if descriptor.interface.hasInterfaceObject():
|
cgThings.append(CGDefineDOMInterfaceMethod(descriptor))
|
||||||
cgThings.append(CGDefineDOMInterfaceMethod(descriptor))
|
|
||||||
|
|
||||||
if descriptor.concrete:
|
if descriptor.concrete:
|
||||||
if descriptor.proxy:
|
if descriptor.proxy:
|
||||||
|
@ -4114,7 +4109,7 @@ class CGRegisterProtos(CGAbstractMethod):
|
||||||
|
|
||||||
def _registerProtos(self):
|
def _registerProtos(self):
|
||||||
lines = [" codegen::Bindings::%sBinding::DefineDOMInterface(window, js_info);" % desc.name
|
lines = [" codegen::Bindings::%sBinding::DefineDOMInterface(window, js_info);" % desc.name
|
||||||
for desc in self.config.getDescriptors(hasInterfaceObject=True,
|
for desc in self.config.getDescriptors(isCallback=False,
|
||||||
register=True)]
|
register=True)]
|
||||||
return '\n'.join(lines) + '\n'
|
return '\n'.join(lines) + '\n'
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue