mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Use CGIndenter for CGWrapMethod.definition_body.
This commit is contained in:
parent
644df404f5
commit
44a609d563
1 changed files with 33 additions and 33 deletions
|
@ -1770,7 +1770,7 @@ class CGWrapMethod(CGAbstractMethod):
|
||||||
|
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
if not self.descriptor.createGlobal:
|
if not self.descriptor.createGlobal:
|
||||||
return CGGeneric("""
|
return CGIndenter(CGGeneric("""
|
||||||
let scope = aScope.reflector().get_jsobject();
|
let scope = aScope.reflector().get_jsobject();
|
||||||
assert!(scope.is_not_null());
|
assert!(scope.is_not_null());
|
||||||
assert!(((*JS_GetClass(scope)).flags & JSCLASS_IS_GLOBAL) != 0);
|
assert!(((*JS_GetClass(scope)).flags & JSCLASS_IS_GLOBAL) != 0);
|
||||||
|
@ -1782,16 +1782,16 @@ class CGWrapMethod(CGAbstractMethod):
|
||||||
|
|
||||||
raw.reflector().set_jsobject(obj);
|
raw.reflector().set_jsobject(obj);
|
||||||
|
|
||||||
return raw;""" % CreateBindingJSObject(self.descriptor, "scope"))
|
return raw;""" % CreateBindingJSObject(self.descriptor, "scope")))
|
||||||
else:
|
else:
|
||||||
return CGGeneric("""
|
return CGIndenter(CGGeneric("""
|
||||||
%s
|
%s
|
||||||
with_compartment(aCx, obj, || {
|
with_compartment(aCx, obj, || {
|
||||||
let proto = GetProtoObject(aCx, obj, obj);
|
let proto = GetProtoObject(aCx, obj, obj);
|
||||||
JS_SetPrototype(aCx, obj, proto);
|
JS_SetPrototype(aCx, obj, proto);
|
||||||
});
|
});
|
||||||
raw.reflector().set_jsobject(obj);
|
raw.reflector().set_jsobject(obj);
|
||||||
return raw;""" % CreateBindingJSObject(self.descriptor))
|
return raw;""" % CreateBindingJSObject(self.descriptor)))
|
||||||
|
|
||||||
|
|
||||||
class CGIDLInterface(CGThing):
|
class CGIDLInterface(CGThing):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue