Bug 793086 (part 1) - Convert JSClassInitializerOp parameter to HandleObject. r=sfink.

--HG--
extra : rebase_source : e8d20aad8abc0bf85df1f05e90be1ce46e8f0125
This commit is contained in:
Nicholas Nethercote 2012-09-20 22:17:49 -07:00
parent 73e57d8345
commit db6466781a
39 changed files with 56 additions and 55 deletions

View File

@ -1180,7 +1180,7 @@ MapObject::iterator(JSContext *cx, unsigned argc, Value *vp)
}
JSObject *
js_InitMapClass(JSContext *cx, JSObject *obj)
js_InitMapClass(JSContext *cx, HandleObject obj)
{
return MapObject::initClass(cx, obj);
}
@ -1521,7 +1521,7 @@ SetObject::iterator(JSContext *cx, unsigned argc, Value *vp)
}
JSObject *
js_InitSetClass(JSContext *cx, JSObject *obj)
js_InitSetClass(JSContext *cx, HandleObject obj)
{
return SetObject::initClass(cx, obj);
}

View File

@ -136,9 +136,9 @@ class SetObject : public JSObject {
} /* namespace js */
extern JSObject *
js_InitMapClass(JSContext *cx, JSObject *obj);
js_InitMapClass(JSContext *cx, js::HandleObject obj);
extern JSObject *
js_InitSetClass(JSContext *cx, JSObject *obj);
js_InitSetClass(JSContext *cx, js::HandleObject obj);
#endif /* MapObject_h__ */

View File

@ -1987,7 +1987,7 @@ ParallelArrayObject::enumerate(JSContext *cx, HandleObject obj, unsigned flags,
}
JSObject *
js_InitParallelArrayClass(JSContext *cx, JSObject *obj)
js_InitParallelArrayClass(JSContext *cx, HandleObject obj)
{
return ParallelArrayObject::initClass(cx, obj);
}

View File

@ -412,6 +412,6 @@ class ParallelArrayObject : public JSObject {
} // namespace js
extern JSObject *
js_InitParallelArrayClass(JSContext *cx, JSObject *obj);
js_InitParallelArrayClass(JSContext *cx, js::HandleObject obj);
#endif // ParallelArray_h__

View File

@ -480,7 +480,7 @@ static JSPropertySpec regexp_static_props[] = {
};
JSObject *
js_InitRegExpClass(JSContext *cx, JSObject *obj)
js_InitRegExpClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -11,7 +11,7 @@
#include "jsprvtd.h"
JSObject *
js_InitRegExpClass(JSContext *cx, JSObject *obj);
js_InitRegExpClass(JSContext *cx, js::HandleObject obj);
/*
* The following builtin natives are extern'd for pointer comparison in

View File

@ -3540,7 +3540,7 @@ js_Array(JSContext *cx, unsigned argc, Value *vp)
}
JSObject *
js_InitArrayClass(JSContext *cx, JSObject *obj)
js_InitArrayClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -41,7 +41,7 @@ js_IdIsIndex(jsid id, uint32_t *indexp)
}
extern JSObject *
js_InitArrayClass(JSContext *cx, JSObject *obj);
js_InitArrayClass(JSContext *cx, js::HandleObject obj);
extern bool
js_InitContextBusyArrayTable(JSContext *cx);

View File

@ -143,7 +143,7 @@ Boolean(JSContext *cx, unsigned argc, Value *vp)
}
JSObject *
js_InitBooleanClass(JSContext *cx, JSObject *obj)
js_InitBooleanClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -14,7 +14,7 @@
#include "jsobj.h"
extern JSObject *
js_InitBooleanClass(JSContext *cx, JSObject *obj);
js_InitBooleanClass(JSContext *cx, js::HandleObject obj);
extern JSString *
js_BooleanToString(JSContext *cx, JSBool b);

View File

@ -3147,7 +3147,7 @@ js_Date(JSContext *cx, unsigned argc, Value *vp)
}
JSObject *
js_InitDateClass(JSContext *cx, JSObject *obj)
js_InitDateClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -41,7 +41,7 @@ TimeClip(double time)
} /* namespace js */
extern JSObject *
js_InitDateClass(JSContext *cx, JSObject *obj);
js_InitDateClass(JSContext *cx, js::HandleObject obj);
/*
* These functions provide a C interface to the date/time object

View File

@ -835,7 +835,7 @@ InitErrorClass(JSContext *cx, Handle<GlobalObject*> global, int type, HandleObje
}
JSObject *
js_InitExceptionClasses(JSContext *cx, JSObject *obj)
js_InitExceptionClasses(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isGlobal());
JS_ASSERT(obj->isNative());

View File

@ -17,7 +17,7 @@
* Initialize the exception constructor/prototype hierarchy.
*/
extern JSObject *
js_InitExceptionClasses(JSContext *cx, JSObject *obj);
js_InitExceptionClasses(JSContext *cx, js::HandleObject obj);
/*
* Given a JSErrorReport, check to see if there is an exception associated with

View File

@ -1881,7 +1881,7 @@ StackTypeSet::getTypedArrayType()
return arrayType;
}
RawObject
JSObject *
StackTypeSet::getSingleton()
{
if (baseFlags() != 0 || baseObjectCount() != 1)
@ -1890,7 +1890,7 @@ StackTypeSet::getSingleton()
return getSingleObject(0);
}
RawObject
JSObject *
HeapTypeSet::getSingleton(JSContext *cx)
{
if (baseFlags() != 0 || baseObjectCount() != 1)

View File

@ -1821,7 +1821,7 @@ GlobalObject::initIteratorClasses(JSContext *cx, Handle<GlobalObject *> global)
}
JSObject *
js_InitIteratorClasses(JSContext *cx, JSObject *obj)
js_InitIteratorClasses(JSContext *cx, HandleObject obj)
{
Rooted<GlobalObject*> global(cx, &obj->asGlobal());
if (!GlobalObject::initIteratorClasses(cx, global))

View File

@ -313,6 +313,6 @@ GeneratorHasMarkableFrame(JSGenerator *gen);
#endif
extern JSObject *
js_InitIteratorClasses(JSContext *cx, JSObject *obj);
js_InitIteratorClasses(JSContext *cx, js::HandleObject obj);
#endif /* jsiter_h___ */

View File

@ -687,9 +687,8 @@ static JSFunctionSpec math_static_methods[] = {
};
JSObject *
js_InitMathClass(JSContext *cx, JSObject *obj_)
js_InitMathClass(JSContext *cx, HandleObject obj)
{
RootedObject obj(cx, obj_);
RootedObject Math(cx, NewObjectWithClassProto(cx, &MathClass, NULL, obj));
if (!Math || !JSObject::setSingletonType(cx, Math))
return NULL;

View File

@ -52,7 +52,7 @@ class MathCache
*/
extern JSObject *
js_InitMathClass(JSContext *cx, JSObject *obj);
js_InitMathClass(JSContext *cx, js::HandleObject obj);
extern void
js_InitRandom(JSContext *cx);

View File

@ -1122,7 +1122,7 @@ FinishRuntimeNumberState(JSRuntime *rt)
} /* namespace js */
JSObject *
js_InitNumberClass(JSContext *cx, JSObject *obj)
js_InitNumberClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -31,7 +31,7 @@ FinishRuntimeNumberState(JSRuntime *rt);
/* Initialize the Number class, returning its prototype object. */
extern JSObject *
js_InitNumberClass(JSContext *cx, JSObject *obj);
js_InitNumberClass(JSContext *cx, js::HandleObject obj);
/*
* String constants for global function names, used in jsapi.c and jsnum.c.

View File

@ -21,12 +21,14 @@
#include "jsatom.h"
#include "jsbool.h"
#include "jscntxt.h"
#include "jsdate.h"
#include "jsversion.h"
#include "jsfun.h"
#include "jsgc.h"
#include "jsinterp.h"
#include "jsiter.h"
#include "jslock.h"
#include "jsmath.h"
#include "jsnum.h"
#include "jsobj.h"
#include "jsonparser.h"
@ -44,6 +46,7 @@
#include "jsxml.h"
#include "builtin/MapObject.h"
#include "builtin/ParallelArray.h"
#include "frontend/BytecodeCompiler.h"
#include "frontend/Parser.h"
#include "gc/Marking.h"
@ -3465,7 +3468,7 @@ JSObject::shrinkElements(JSContext *cx, unsigned newcap)
}
static JSObject *
js_InitNullClass(JSContext *cx, JSObject *obj)
js_InitNullClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(0);
return NULL;

View File

@ -899,7 +899,7 @@ static JSFunctionSpec json_static_methods[] = {
};
JSObject *
js_InitJSONClass(JSContext *cx, JSObject *obj)
js_InitJSONClass(JSContext *cx, HandleObject obj)
{
Rooted<GlobalObject*> global(cx, &obj->asGlobal());

View File

@ -15,7 +15,7 @@
#define JSON_PARSER_BUFSIZE 1024
extern JSObject *
js_InitJSONClass(JSContext *cx, JSObject *obj);
js_InitJSONClass(JSContext *cx, js::HandleObject obj);
extern JSBool
js_Stringify(JSContext *cx, js::MutableHandleValue vp,

View File

@ -3215,9 +3215,8 @@ static JSFunctionSpec static_methods[] = {
};
JS_FRIEND_API(JSObject *)
js_InitProxyClass(JSContext *cx, JSObject *obj_)
js_InitProxyClass(JSContext *cx, HandleObject obj)
{
RootedObject obj(cx, obj_);
RootedObject module(cx, NewObjectWithClassProto(cx, &ProxyClass, NULL, obj));
if (!module || !JSObject::setSingletonType(cx, module))
return NULL;

View File

@ -348,7 +348,7 @@ NewProxyObject(JSContext *cx, BaseProxyHandler *handler, const Value &priv,
JS_BEGIN_EXTERN_C
extern JS_FRIEND_API(JSObject *)
js_InitProxyClass(JSContext *cx, JSObject *obj);
js_InitProxyClass(JSContext *cx, JSHandleObject obj);
JS_END_EXTERN_C

View File

@ -370,7 +370,7 @@ typedef JSObject *
/* Signature for class initialization ops. */
typedef JSObject *
(* JSClassInitializerOp)(JSContext *cx, JSObject *obj);
(* JSClassInitializerOp)(JSContext *cx, JSHandleObject obj);
/*
* Hook that creates an iterator object for a given object. Returns the

View File

@ -3225,7 +3225,7 @@ StringObject::assignInitialShape(JSContext *cx)
}
JSObject *
js_InitStringClass(JSContext *cx, JSObject *obj)
js_InitStringClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -70,7 +70,7 @@ extern JSSubString js_EmptySubString;
/* Initialize the String class, returning its prototype object. */
extern JSObject *
js_InitStringClass(JSContext *cx, JSObject *obj);
js_InitStringClass(JSContext *cx, js::HandleObject obj);
extern const char js_escape_str[];
extern const char js_unescape_str[];

View File

@ -3458,7 +3458,7 @@ DataViewObject::initClass(JSContext *cx)
}
JSObject *
js_InitTypedArrayClasses(JSContext *cx, JSObject *obj)
js_InitTypedArrayClasses(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());
Rooted<GlobalObject*> global(cx, &obj->asGlobal());

View File

@ -362,7 +362,7 @@ static JSFunctionSpec weak_map_methods[] = {
};
JSObject *
js_InitWeakMapClass(JSContext *cx, JSObject *obj)
js_InitWeakMapClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -226,6 +226,6 @@ class WeakMap : public HashMap<Key, Value, HashPolicy, RuntimeAllocPolicy>, publ
} /* namespace js */
extern JSObject *
js_InitWeakMapClass(JSContext *cx, JSObject *obj);
js_InitWeakMapClass(JSContext *cx, js::HandleObject obj);
#endif

View File

@ -7327,7 +7327,7 @@ js_GetXMLObject(JSContext *cx, JSXML *xmlArg)
}
JSObject *
js_InitNamespaceClass(JSContext *cx, JSObject *obj)
js_InitNamespaceClass(JSContext *cx, HandleObject obj)
{
cx->runtime->gcExactScanningEnabled = false;
@ -7361,7 +7361,7 @@ js_InitNamespaceClass(JSContext *cx, JSObject *obj)
}
JSObject *
js_InitQNameClass(JSContext *cx, JSObject *obj)
js_InitQNameClass(JSContext *cx, HandleObject obj)
{
cx->runtime->gcExactScanningEnabled = false;
@ -7394,7 +7394,7 @@ js_InitQNameClass(JSContext *cx, JSObject *obj)
}
JSObject *
js_InitXMLClass(JSContext *cx, JSObject *obj)
js_InitXMLClass(JSContext *cx, HandleObject obj)
{
cx->runtime->gcExactScanningEnabled = false;
Rooted<GlobalObject *> global(cx, &obj->asGlobal());
@ -7456,7 +7456,7 @@ js_InitXMLClass(JSContext *cx, JSObject *obj)
}
JSObject *
js_InitXMLClasses(JSContext *cx, JSObject *obj)
js_InitXMLClasses(JSContext *cx, HandleObject obj)
{
if (!js_InitNamespaceClass(cx, obj))
return NULL;

View File

@ -15,11 +15,11 @@
#if JS_HAS_XML_SUPPORT
extern JSObject *
js_InitXMLClass(JSContext *cx, JSObject *obj);
js_InitXMLClass(JSContext *cx, js::HandleObject obj);
extern JSObject *
js_InitNamespaceClass(JSContext *cx, JSObject *obj);
js_InitNamespaceClass(JSContext *cx, js::HandleObject obj);
extern JSObject *
js_InitQNameClass(JSContext *cx, JSObject *obj);
js_InitQNameClass(JSContext *cx, js::HandleObject obj);
#else
#define js_InitXMLClass js_InitNullClass
#define js_InitNamespaceClass js_InitNullClass
@ -210,7 +210,7 @@ extern JSObject *
js_GetXMLObject(JSContext *cx, JSXML *xml);
extern JSObject *
js_InitXMLClasses(JSContext *cx, JSObject *obj);
js_InitXMLClasses(JSContext *cx, js::HandleObject obj);
/*
* If obj is a QName corresponding to function::name, set *funidp to name's id

View File

@ -43,7 +43,7 @@ class BooleanObject : public JSObject
/* For access to init, as Boolean.prototype is special. */
friend JSObject *
::js_InitBooleanClass(JSContext *cx, JSObject *global);
::js_InitBooleanClass(JSContext *cx, js::HandleObject global);
};
} // namespace js

View File

@ -33,7 +33,7 @@
using namespace js;
JSObject *
js_InitObjectClass(JSContext *cx, JSObject *obj)
js_InitObjectClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());
@ -41,7 +41,7 @@ js_InitObjectClass(JSContext *cx, JSObject *obj)
}
JSObject *
js_InitFunctionClass(JSContext *cx, JSObject *obj)
js_InitFunctionClass(JSContext *cx, HandleObject obj)
{
JS_ASSERT(obj->isNative());

View File

@ -22,13 +22,13 @@
#include "builtin/RegExp.h"
extern JSObject *
js_InitObjectClass(JSContext *cx, JSObject *obj);
js_InitObjectClass(JSContext *cx, js::HandleObject obj);
extern JSObject *
js_InitFunctionClass(JSContext *cx, JSObject *obj);
js_InitFunctionClass(JSContext *cx, js::HandleObject obj);
extern JSObject *
js_InitTypedArrayClasses(JSContext *cx, JSObject *obj);
js_InitTypedArrayClasses(JSContext *cx, js::HandleObject obj);
namespace js {
@ -114,9 +114,9 @@ class GlobalObject : public JSObject
}
friend JSObject *
::js_InitObjectClass(JSContext *cx, JSObject *obj);
::js_InitObjectClass(JSContext *cx, js::HandleObject);
friend JSObject *
::js_InitFunctionClass(JSContext *cx, JSObject *obj);
::js_InitFunctionClass(JSContext *cx, js::HandleObject);
/* Initialize the Function and Object classes. Must only be called once! */
JSObject *

View File

@ -43,7 +43,7 @@ class NumberObject : public JSObject
/* For access to init, as Number.prototype is special. */
friend JSObject *
::js_InitNumberClass(JSContext *cx, JSObject *global);
::js_InitNumberClass(JSContext *cx, js::HandleObject global);
};
} // namespace js

View File

@ -56,7 +56,7 @@ class StringObject : public JSObject
/* For access to init, as String.prototype is special. */
friend JSObject *
::js_InitStringClass(JSContext *cx, JSObject *global);
::js_InitStringClass(JSContext *cx, js::HandleObject global);
/*
* Compute the initial shape to associate with fresh String objects, which