Bug 898263 (part 5) - Move some ClassExtension function typedefs out of jsprvtd.h. r=jorendorff.

--HG--
extra : rebase_source : 9899c4534052a4ba3f4bce78e4e0a84a7576d3bc
This commit is contained in:
Nicholas Nethercote 2013-07-25 22:52:58 -07:00
parent 1399d1419a
commit 00e97bc998
5 changed files with 19 additions and 24 deletions

View File

@ -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;

View File

@ -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<JSObject*> 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);

View File

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

View File

@ -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 */
/*

View File

@ -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<JSObject*> 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 */