Bug 789295 - Reformat class method declarations to look like rest of spidermonkey. r=billm
authorSteve Fink <sfink@mozilla.com>
Tue, 18 Sep 2012 09:58:36 -0700
changeset 108153 9367895cc67f2393762991dd03dab00285956c60
parent 108152 124223c5129eb83a806098361414ca2c4340495d
child 108154 b5273d58d158f5ff4f62b54111c80a60aa193982
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersbillm
bugs789295
milestone18.0a1
Bug 789295 - Reformat class method declarations to look like rest of spidermonkey. r=billm
js/src/jstypedarray.h
--- a/js/src/jstypedarray.h
+++ b/js/src/jstypedarray.h
@@ -44,127 +44,112 @@ class ArrayBufferObject : public JSObjec
 
     static JSObject *createSlice(JSContext *cx, ArrayBufferObject &arrayBuffer,
                                  uint32_t begin, uint32_t end);
 
     static bool createDataViewForThisImpl(JSContext *cx, CallArgs args);
     static JSBool createDataViewForThis(JSContext *cx, unsigned argc, Value *vp);
 
     template<typename T>
-    static bool
-    createTypedArrayFromBufferImpl(JSContext *cx, CallArgs args);
+    static bool createTypedArrayFromBufferImpl(JSContext *cx, CallArgs args);
 
     template<typename T>
-    static JSBool
-    createTypedArrayFromBuffer(JSContext *cx, unsigned argc, Value *vp);
+    static JSBool createTypedArrayFromBuffer(JSContext *cx, unsigned argc, Value *vp);
 
-    static void
-    obj_trace(JSTracer *trc, JSObject *obj);
+    static void obj_trace(JSTracer *trc, JSObject *obj);
 
-    static JSBool
-    obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id,
-                      MutableHandleObject objp, MutableHandleShape propp);
-    static JSBool
-    obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name,
-                       MutableHandleObject objp, MutableHandleShape propp);
-    static JSBool
-    obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index,
-                      MutableHandleObject objp, MutableHandleShape propp);
-    static JSBool
-    obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid,
-                      MutableHandleObject objp, MutableHandleShape propp);
+    static JSBool obj_lookupGeneric(JSContext *cx, HandleObject obj, HandleId id,
+                                    MutableHandleObject objp, MutableHandleShape propp);
+    static JSBool obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name,
+                                     MutableHandleObject objp, MutableHandleShape propp);
+    static JSBool obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index,
+                                    MutableHandleObject objp, MutableHandleShape propp);
+    static JSBool obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid,
+                                    MutableHandleObject objp, MutableHandleShape propp);
 
-    static JSBool
-    obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue v,
-                      PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
-    static JSBool
-    obj_defineProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue v,
-                       PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
-    static JSBool
-    obj_defineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue v,
-                      PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
-    static JSBool
-    obj_defineSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue v,
-                      PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+    static JSBool obj_defineGeneric(JSContext *cx, HandleObject obj, HandleId id, HandleValue v,
+                                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+    static JSBool obj_defineProperty(JSContext *cx, HandleObject obj,
+                                     HandlePropertyName name, HandleValue v,
+                                     PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+    static JSBool obj_defineElement(JSContext *cx, HandleObject obj, uint32_t index, HandleValue v,
+                                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
+    static JSBool obj_defineSpecial(JSContext *cx, HandleObject obj,
+                                    HandleSpecialId sid, HandleValue v,
+                                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);
 
-    static JSBool
-    obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);
+    static JSBool obj_getGeneric(JSContext *cx, HandleObject obj, HandleObject receiver,
+                                 HandleId id, MutableHandleValue vp);
 
-    static JSBool
-    obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name,
-                    MutableHandleValue vp);
+    static JSBool obj_getProperty(JSContext *cx, HandleObject obj, HandleObject receiver,
+                                  HandlePropertyName name, MutableHandleValue vp);
 
-    static JSBool
-    obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);
-    static JSBool
-    obj_getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index,
-                            MutableHandleValue vp, bool *present);
+    static JSBool obj_getElement(JSContext *cx, HandleObject obj, HandleObject receiver,
+                                 uint32_t index, MutableHandleValue vp);
+    static JSBool obj_getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,
+                                          uint32_t index, MutableHandleValue vp, bool *present);
 
-    static JSBool
-    obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);
+    static JSBool obj_getSpecial(JSContext *cx, HandleObject obj, HandleObject receiver,
+                                 HandleSpecialId sid, MutableHandleValue vp);
 
-    static JSBool
-    obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict);
-    static JSBool
-    obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict);
-    static JSBool
-    obj_setElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict);
-    static JSBool
-    obj_setSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict);
+    static JSBool obj_setGeneric(JSContext *cx, HandleObject obj, HandleId id,
+                                 MutableHandleValue vp, JSBool strict);
+    static JSBool obj_setProperty(JSContext *cx, HandleObject obj, HandlePropertyName name,
+                                  MutableHandleValue vp, JSBool strict);
+    static JSBool obj_setElement(JSContext *cx, HandleObject obj, uint32_t index,
+                                 MutableHandleValue vp, JSBool strict);
+    static JSBool obj_setSpecial(JSContext *cx, HandleObject obj,
+                                 HandleSpecialId sid, MutableHandleValue vp, JSBool strict);
 
-    static JSBool
-    obj_getGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
-    static JSBool
-    obj_getPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
-    static JSBool
-    obj_getElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
-    static JSBool
-    obj_getSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
+    static JSBool obj_getGenericAttributes(JSContext *cx, HandleObject obj,
+                                           HandleId id, unsigned *attrsp);
+    static JSBool obj_getPropertyAttributes(JSContext *cx, HandleObject obj,
+                                            HandlePropertyName name, unsigned *attrsp);
+    static JSBool obj_getElementAttributes(JSContext *cx, HandleObject obj,
+                                           uint32_t index, unsigned *attrsp);
+    static JSBool obj_getSpecialAttributes(JSContext *cx, HandleObject obj,
+                                           HandleSpecialId sid, unsigned *attrsp);
 
-    static JSBool
-    obj_setGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
-    static JSBool
-    obj_setPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
-    static JSBool
-    obj_setElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
-    static JSBool
-    obj_setSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
-
-    static JSBool
-    obj_deleteProperty(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue rval, JSBool strict);
-    static JSBool
-    obj_deleteElement(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue rval, JSBool strict);
-    static JSBool
-    obj_deleteSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue rval, JSBool strict);
+    static JSBool obj_setGenericAttributes(JSContext *cx, HandleObject obj,
+                                           HandleId id, unsigned *attrsp);
+    static JSBool obj_setPropertyAttributes(JSContext *cx, HandleObject obj,
+                                            HandlePropertyName name, unsigned *attrsp);
+    static JSBool obj_setElementAttributes(JSContext *cx, HandleObject obj,
+                                           uint32_t index, unsigned *attrsp);
+    static JSBool obj_setSpecialAttributes(JSContext *cx, HandleObject obj,
+                                           HandleSpecialId sid, unsigned *attrsp);
 
-    static JSBool
-    obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op,
-                  MutableHandleValue statep, MutableHandleId idp);
-
-    static bool
-    stealContents(JSContext *cx, JSObject *obj, void **contents);
+    static JSBool obj_deleteProperty(JSContext *cx, HandleObject obj,
+                                     HandlePropertyName name, MutableHandleValue rval,
+                                     JSBool strict);
+    static JSBool obj_deleteElement(JSContext *cx, HandleObject obj,
+                                    uint32_t index, MutableHandleValue rval,
+                                    JSBool strict);
+    static JSBool obj_deleteSpecial(JSContext *cx, HandleObject obj,
+                                    HandleSpecialId sid, MutableHandleValue rval,
+                                    JSBool strict);
 
-    static inline void
-    setElementsHeader(js::ObjectElements *header, uint32_t bytes);
+    static JSBool obj_enumerate(JSContext *cx, HandleObject obj, JSIterateOp enum_op,
+                                MutableHandleValue statep, MutableHandleId idp);
 
-    void
-    addView(JSContext *cx, RawObject view);
+    static bool stealContents(JSContext *cx, JSObject *obj, void **contents);
 
-    void
-    removeFinalizedView(FreeOp *fop, RawObject view);
+    static inline void setElementsHeader(js::ObjectElements *header, uint32_t bytes);
+
+    void addView(JSContext *cx, RawObject view);
 
-    bool
-    allocateSlots(JSContext *cx, uint32_t size, uint8_t *contents = NULL);
+    void removeFinalizedView(FreeOp *fop, RawObject view);
+
+    bool allocateSlots(JSContext *cx, uint32_t size, uint8_t *contents = NULL);
 
     /*
      * Ensure that the data is not stored inline. Used when handing back a
      * GC-safe pointer.
      */
-    bool
-    uninlineData(JSContext *cx);
+    bool uninlineData(JSContext *cx);
 
     inline uint32_t byteLength() const;
 
     inline uint8_t * dataPointer() const;
 
    /*
      * Check if the arrayBuffer contains any data. This will return false for
      * ArrayBuffer.prototype and neutered ArrayBuffers.
@@ -224,45 +209,51 @@ struct TypedArray {
                                     MutableHandleObject objp, MutableHandleShape propp);
     static JSBool obj_lookupProperty(JSContext *cx, HandleObject obj, HandlePropertyName name,
                                      MutableHandleObject objp, MutableHandleShape propp);
     static JSBool obj_lookupElement(JSContext *cx, HandleObject obj, uint32_t index,
                                     MutableHandleObject objp, MutableHandleShape propp);
     static JSBool obj_lookupSpecial(JSContext *cx, HandleObject obj, HandleSpecialId sid,
                                     MutableHandleObject objp, MutableHandleShape propp);
 
-    static JSBool obj_getGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
-    static JSBool obj_getPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
-    static JSBool obj_getElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
-    static JSBool obj_getSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
+    static JSBool obj_getGenericAttributes(JSContext *cx, HandleObject obj,
+                                           HandleId id, unsigned *attrsp);
+    static JSBool obj_getPropertyAttributes(JSContext *cx, HandleObject obj,
+                                            HandlePropertyName name, unsigned *attrsp);
+    static JSBool obj_getElementAttributes(JSContext *cx, HandleObject obj,
+                                           uint32_t index, unsigned *attrsp);
+    static JSBool obj_getSpecialAttributes(JSContext *cx, HandleObject obj,
+                                           HandleSpecialId sid, unsigned *attrsp);
 
-    static JSBool obj_setGenericAttributes(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);
-    static JSBool obj_setPropertyAttributes(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);
-    static JSBool obj_setElementAttributes(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);
-    static JSBool obj_setSpecialAttributes(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);
+    static JSBool obj_setGenericAttributes(JSContext *cx, HandleObject obj,
+                                           HandleId id, unsigned *attrsp);
+    static JSBool obj_setPropertyAttributes(JSContext *cx, HandleObject obj,
+                                            HandlePropertyName name, unsigned *attrsp);
+    static JSBool obj_setElementAttributes(JSContext *cx, HandleObject obj,
+                                           uint32_t index, unsigned *attrsp);
+    static JSBool obj_setSpecialAttributes(JSContext *cx, HandleObject obj,
+                                           HandleSpecialId sid, unsigned *attrsp);
 
     static inline Value bufferValue(JSObject *obj);
     static inline Value byteOffsetValue(JSObject *obj);
     static inline Value byteLengthValue(JSObject *obj);
     static inline Value lengthValue(JSObject *obj);
 
     static inline ArrayBufferObject * buffer(JSObject *obj);
     static inline uint32_t byteOffset(JSObject *obj);
     static inline uint32_t byteLength(JSObject *obj);
     static inline uint32_t length(JSObject *obj);
 
     static inline uint32_t type(JSObject *obj);
     static inline void * viewData(JSObject *obj);
 
   public:
-    static bool
-    isArrayIndex(JSContext *cx, JSObject *obj, jsid id, uint32_t *ip = NULL);
+    static bool isArrayIndex(JSContext *cx, JSObject *obj, jsid id, uint32_t *ip = NULL);
 
-    static void
-    neuter(JSContext *cx, RawObject tarray);
+    static void neuter(JSContext *cx, RawObject tarray);
 
     static inline uint32_t slotWidth(int atype);
     static inline int slotWidth(JSObject *obj);
 
     /*
      * Byte length above which created typed arrays and data views will have
      * singleton types regardless of the context in which they are created.
      */
@@ -317,17 +308,18 @@ private:
     static const size_t RESERVED_SLOTS  = 7;
 
     static inline Value bufferValue(DataViewObject &view);
     static inline Value byteOffsetValue(DataViewObject &view);
     static inline Value byteLengthValue(DataViewObject &view);
 
     static JSBool class_constructor(JSContext *cx, unsigned argc, Value *vp);
     static JSBool constructWithProto(JSContext *cx, unsigned argc, Value *vp);
-    static JSBool construct(JSContext *cx, JSObject *bufobj, const CallArgs &args, JSObject *proto);
+    static JSBool construct(JSContext *cx, JSObject *bufobj, const CallArgs &args,
+                            JSObject *proto);
 
     static inline DataViewObject *
     create(JSContext *cx, uint32_t byteOffset, uint32_t byteLength,
            Handle<ArrayBufferObject*> arrayBuffer, JSObject *proto);
 
     static bool getInt8Impl(JSContext *cx, CallArgs args);
     static JSBool fun_getInt8(JSContext *cx, unsigned argc, Value *vp);
 
@@ -371,18 +363,17 @@ private:
     static JSBool fun_setUint32(JSContext *cx, unsigned argc, Value *vp);
 
     static bool setFloat32Impl(JSContext *cx, CallArgs args);
     static JSBool fun_setFloat32(JSContext *cx, unsigned argc, Value *vp);
 
     static bool setFloat64Impl(JSContext *cx, CallArgs args);
     static JSBool fun_setFloat64(JSContext *cx, unsigned argc, Value *vp);
 
-    static void
-    obj_finalize(FreeOp *fop, JSObject *obj);
+    static void obj_finalize(FreeOp *fop, JSObject *obj);
 
     inline uint32_t byteLength();
     inline uint32_t byteOffset();
     inline ArrayBufferObject & arrayBuffer();
     inline void *dataPointer();
     inline bool hasBuffer() const;
     static JSObject *initClass(JSContext *cx);
     static bool getDataPointer(JSContext *cx, Handle<DataViewObject*> obj,