mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +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):
|
||||
if not self.descriptor.createGlobal:
|
||||
return CGGeneric("""
|
||||
return CGIndenter(CGGeneric("""
|
||||
let scope = aScope.reflector().get_jsobject();
|
||||
assert!(scope.is_not_null());
|
||||
assert!(((*JS_GetClass(scope)).flags & JSCLASS_IS_GLOBAL) != 0);
|
||||
|
@ -1782,16 +1782,16 @@ class CGWrapMethod(CGAbstractMethod):
|
|||
|
||||
raw.reflector().set_jsobject(obj);
|
||||
|
||||
return raw;""" % CreateBindingJSObject(self.descriptor, "scope"))
|
||||
return raw;""" % CreateBindingJSObject(self.descriptor, "scope")))
|
||||
else:
|
||||
return CGGeneric("""
|
||||
return CGIndenter(CGGeneric("""
|
||||
%s
|
||||
with_compartment(aCx, obj, || {
|
||||
let proto = GetProtoObject(aCx, obj, obj);
|
||||
JS_SetPrototype(aCx, obj, proto);
|
||||
});
|
||||
raw.reflector().set_jsobject(obj);
|
||||
return raw;""" % CreateBindingJSObject(self.descriptor))
|
||||
return raw;""" % CreateBindingJSObject(self.descriptor)))
|
||||
|
||||
|
||||
class CGIDLInterface(CGThing):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue