Fix some generated code formatting issues.
authorBobby Holley <bobbyholley@gmail.com>
Fri, 27 Jan 2012 10:57:26 +0100
changeset 85152 be14d1424179f715ee3665c3e8010c3555e74149
parent 85151 45bb8983777618c73775dcb52c81255764b5ae38
child 85153 c6384b9cfc5ba54b75eb67760de5e16d12cd2fdc
push id54
push userbobbyholley@gmail.com
push dateFri, 27 Jan 2012 09:57:33 +0000
milestone12.0a1
Fix some generated code formatting issues.
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -60,17 +60,17 @@ class AbstractMethod(CodegenThing):
         if self.inline:
             return self._define()
         return "%s %s(%s);\n" % (self.returnType, self.name, self._argstring())
     def _define(self):
         return self.definition_prologue() + self.definition_body() + self.definition_epilogue()
     def define(self):
         return "" if self.inline else self._define()
     def definition_prologue(self):
-        maybeNewline = "" if self.inline else "\n"
+        maybeNewline = " " if self.inline else "\n"
         return "%s%s%s(%s)\n{" % (self.returnType, maybeNewline, self.name, self._argstring())
     def definition_epilogue(self):
         return "\n}\n"
     def definition_body(self):
         return "" # Override me!
 
 class CreateProtoObjectMethod(AbstractMethod):
     def __init__(self, implementation):
@@ -98,33 +98,33 @@ class CreateProtoObjectMethod(AbstractMe
 
 class GetProtoObjectMethod(AbstractMethod):
     def __init__(self, implementation):
         args = [Argument('JSContext*', 'aCx'), Argument('JSObject*', 'aGlobal')]
         AbstractMethod.__init__(self, implementation, 'GetProtoObject',
                                 'JSObject*', args, inline=True)
     def definition_body(self):
         return """
-    /* Get the prototype object for this class.  This will create the prototype
-       as needed. */
+  /* Get the prototype object for this class.  This will create the prototype
+     as needed. */
 
-    /* Make sure our global is sane.  Hopefully we can remove this sometime */
-    if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
-      return NULL;
-    }
-    /* Check to see whether the prototype is already installed */
-    JSObject **protoArray =
-      static_cast<JSObject**>(js::GetReservedSlot(aGlobal, DOM_PROTOTYPE_SLOT).toPrivate());
-    JSObject *ourProto = protoArray[id::%s];
-    if (!ourProto) {
-      ourProto = protoArray[id::%s] = CreateProtoObject(aCx, aGlobal);
-    }
+  /* Make sure our global is sane.  Hopefully we can remove this sometime */
+  if (!(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL)) {
+    return NULL;
+  }
+  /* Check to see whether the prototype is already installed */
+  JSObject **protoArray =
+    static_cast<JSObject**>(js::GetReservedSlot(aGlobal, DOM_PROTOTYPE_SLOT).toPrivate());
+  JSObject *ourProto = protoArray[id::%s];
+  if (!ourProto) {
+    ourProto = protoArray[id::%s] = CreateProtoObject(aCx, aGlobal);
+  }
 
-    /* ourProto might _still_ be null, but that's OK */
-    return ourProto;""" % (self.implementation.domClass.name, self.implementation.domClass.name)
+  /* ourProto might _still_ be null, but that's OK */
+  return ourProto;""" % (self.implementation.domClass.name, self.implementation.domClass.name)
 
 
 class DOMClassImplementation():
     def __init__(self, domClass, implConf):
         self.domClass = domClass
         self.nativeClass = implConf['nativeClass']
         self.workers = implConf.get('workers', False)
         if self.workers: