Use CGIndenter for CGWrapMethod.definition_body.

This commit is contained in:
Ms2ger 2014-06-21 13:37:18 +02:00
parent 644df404f5
commit 44a609d563

View file

@ -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):