mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use CGIndenter for CGDefineDOMInterfaceMethod.definition_body.
This commit is contained in:
parent
b717fbe868
commit
fa7a0aae75
1 changed files with 38 additions and 38 deletions
|
@ -2007,10 +2007,10 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
return CGAbstractMethod.define(self)
|
return CGAbstractMethod.define(self)
|
||||||
|
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
body = ""
|
body = CGList([])
|
||||||
#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:
|
||||||
body += """ let traps = ProxyTraps {
|
body.append(CGGeneric("""let traps = ProxyTraps {
|
||||||
getPropertyDescriptor: Some(getPropertyDescriptor),
|
getPropertyDescriptor: Some(getPropertyDescriptor),
|
||||||
getOwnPropertyDescriptor: Some(getOwnPropertyDescriptor),
|
getOwnPropertyDescriptor: Some(getOwnPropertyDescriptor),
|
||||||
defineProperty: Some(defineProperty),
|
defineProperty: Some(defineProperty),
|
||||||
|
@ -2046,15 +2046,15 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
|
|
||||||
""" % (FINALIZE_HOOK_NAME,
|
""" % (FINALIZE_HOOK_NAME,
|
||||||
TRACE_HOOK_NAME,
|
TRACE_HOOK_NAME,
|
||||||
self.descriptor.name)
|
self.descriptor.name)))
|
||||||
|
|
||||||
if self.descriptor.interface.hasInterfaceObject():
|
if self.descriptor.interface.hasInterfaceObject():
|
||||||
body += """ let cx = (**js_info.js_context).ptr;
|
body.append(CGGeneric("""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!(GetProtoObject(cx, global, global).is_not_null());"""
|
assert!(GetProtoObject(cx, global, global).is_not_null());"""))
|
||||||
|
|
||||||
return CGGeneric(body)
|
return CGIndenter(body)
|
||||||
|
|
||||||
def needCx(returnType, arguments, extendedAttributes, considerTypes):
|
def needCx(returnType, arguments, extendedAttributes, considerTypes):
|
||||||
return (considerTypes and
|
return (considerTypes and
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue