diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index ccb028aea1e..1b135cdf5e4 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1362,7 +1362,7 @@ JS_InitStandardClasses(JSContext *cx, JSObject *objArg) #define EAGER_ATOM_AND_OCLASP(name) EAGER_CLASS_ATOM(name), OCLASP(name) typedef struct JSStdName { - JSClassInitializerOp init; + ClassInitializerOp init; size_t atomOffset; /* offset of atom pointer in JSAtomState */ Class *clasp; } JSStdName; diff --git a/js/src/jsapi.h b/js/src/jsapi.h index b2fdfb78e59..53ae6d49cfa 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -948,6 +948,20 @@ typedef void typedef void (* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize); +/* + * A generic type for functions mapping an object to another object, or null + * if an error or exception was thrown on cx. + */ +typedef JSObject * +(* JSObjectOp)(JSContext *cx, JS::Handle obj); + +/* + * Hook that creates an iterator object for a given object. Returns the + * iterator object or null if an error or exception was thrown on cx. + */ +typedef JSObject * +(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, bool keysonly); + typedef JSObject * (* JSWeakmapKeyDelegateOp)(JSObject *obj); diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index e9435ee8a71..52f87049454 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -2980,7 +2980,7 @@ js_InitNullClass(JSContext *cx, HandleObject obj) JS_FOR_EACH_PROTOTYPE(DECLARE_PROTOTYPE_CLASS_INIT) #undef DECLARE_PROTOTYPE_CLASS_INIT -static JSClassInitializerOp lazy_prototype_init[JSProto_LIMIT] = { +static ClassInitializerOp lazy_prototype_init[JSProto_LIMIT] = { #define LAZY_PROTOTYPE_INIT(name,code,init) init, JS_FOR_EACH_PROTOTYPE(LAZY_PROTOTYPE_INIT) #undef LAZY_PROTOTYPE_INIT @@ -3104,7 +3104,7 @@ js_GetClassObject(ExclusiveContext *cxArg, JSObject *obj, JSProtoKey key, Mutabl } RootedObject cobj(cx, NULL); - if (JSClassInitializerOp init = lazy_prototype_init[key]) { + if (ClassInitializerOp init = lazy_prototype_init[key]) { if (!init(cx, global)) return false; v = global->getReservedSlot(key); diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 9567e2a5b25..027d8c17919 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -1107,6 +1107,8 @@ IsStandardClassResolved(JSObject *obj, js::Class *clasp); void MarkStandardClassInitializedNoProto(JSObject *obj, js::Class *clasp); +typedef JSObject *(*ClassInitializerOp)(JSContext *cx, JS::HandleObject obj); + } /* namespace js */ /* diff --git a/js/src/jsprvtd.h b/js/src/jsprvtd.h index aee0519e12d..bdf060d1a5d 100644 --- a/js/src/jsprvtd.h +++ b/js/src/jsprvtd.h @@ -66,25 +66,4 @@ struct IdValuePair } /* namespace js */ -/* js::ObjectOps function pointer typedefs. */ - -/* - * A generic type for functions mapping an object to another object, or null - * if an error or exception was thrown on cx. - */ -typedef JSObject * -(* JSObjectOp)(JSContext *cx, JS::Handle obj); - -/* Signature for class initialization ops. */ -typedef JSObject * -(* JSClassInitializerOp)(JSContext *cx, JS::HandleObject obj); - -/* - * Hook that creates an iterator object for a given object. Returns the - * iterator object or null if an error or exception was thrown on cx. - */ -typedef JSObject * -(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, bool keysonly); - - #endif /* jsprvtd_h */