зеркало из https://github.com/mozilla/pjs.git
Bug 413730 - Replace all OBJ_GET_CLASS() macro calls with JSObject::getClass() calls. r=gal.
This commit is contained in:
Родитель
66e4bb9ad7
Коммит
9921f31681
|
@ -1467,7 +1467,7 @@ JS_ResolveStandardClass(JSContext *cx, JSObject *obj, jsval id,
|
|||
*/
|
||||
if (stdnm->clasp &&
|
||||
(stdnm->clasp->flags & JSCLASS_IS_ANONYMOUS) &&
|
||||
(OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL)) {
|
||||
(obj->getClass()->flags & JSCLASS_IS_GLOBAL)) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
@ -2633,7 +2633,7 @@ JS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv)
|
|||
JSFunction *fun;
|
||||
|
||||
CHECK_REQUEST(cx);
|
||||
if (obj && OBJ_GET_CLASS(cx, obj) == clasp)
|
||||
if (obj && obj->getClass() == clasp)
|
||||
return JS_TRUE;
|
||||
if (argv) {
|
||||
fun = js_ValueToFunction(cx, &argv[-2], 0);
|
||||
|
@ -2642,7 +2642,7 @@ JS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv)
|
|||
JSMSG_INCOMPATIBLE_PROTO,
|
||||
clasp->name, JS_GetFunctionName(fun),
|
||||
obj
|
||||
? OBJ_GET_CLASS(cx, obj)->name
|
||||
? obj->getClass()->name
|
||||
: js_null_str);
|
||||
}
|
||||
}
|
||||
|
@ -2726,7 +2726,7 @@ JS_GetConstructor(JSContext *cx, JSObject *proto)
|
|||
}
|
||||
if (!VALUE_IS_FUNCTION(cx, cval)) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NO_CONSTRUCTOR,
|
||||
OBJ_GET_CLASS(cx, proto)->name);
|
||||
proto->getClass()->name);
|
||||
return NULL;
|
||||
}
|
||||
return JSVAL_TO_OBJECT(cval);
|
||||
|
@ -2773,7 +2773,7 @@ JS_SealObject(JSContext *cx, JSObject *obj, JSBool deep)
|
|||
if (!obj->isNative()) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
|
||||
JSMSG_CANT_SEAL_OBJECT,
|
||||
OBJ_GET_CLASS(cx, obj)->name);
|
||||
obj->getClass()->name);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
|
@ -3048,7 +3048,7 @@ JS_AliasProperty(JSContext *cx, JSObject *obj, const char *name,
|
|||
if (obj2 != obj || !obj->isNative()) {
|
||||
obj2->dropProperty(cx, prop);
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_ALIAS,
|
||||
alias, name, OBJ_GET_CLASS(cx, obj2)->name);
|
||||
alias, name, obj2->getClass()->name);
|
||||
return JS_FALSE;
|
||||
}
|
||||
atom = js_Atomize(cx, alias, strlen(alias), 0);
|
||||
|
@ -3732,7 +3732,7 @@ JS_AliasElement(JSContext *cx, JSObject *obj, const char *name, jsint alias)
|
|||
obj2->dropProperty(cx, prop);
|
||||
JS_snprintf(numBuf, sizeof numBuf, "%ld", (long)alias);
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_ALIAS,
|
||||
numBuf, name, OBJ_GET_CLASS(cx, obj2)->name);
|
||||
numBuf, name, obj2->getClass()->name);
|
||||
return JS_FALSE;
|
||||
}
|
||||
sprop = (JSScopeProperty *)prop;
|
||||
|
@ -3827,7 +3827,7 @@ JS_ClearScope(JSContext *cx, JSObject *obj)
|
|||
obj->map->ops->clear(cx, obj);
|
||||
|
||||
/* Clear cached class objects on the global object. */
|
||||
if (OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL) {
|
||||
if (obj->getClass()->flags & JSCLASS_IS_GLOBAL) {
|
||||
int key;
|
||||
|
||||
for (key = JSProto_Null; key < JSProto_LIMIT; key++)
|
||||
|
@ -4134,7 +4134,7 @@ JS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent)
|
|||
JS_ASSERT(parent);
|
||||
}
|
||||
|
||||
if (OBJ_GET_CLASS(cx, funobj) != &js_FunctionClass) {
|
||||
if (funobj->getClass() != &js_FunctionClass) {
|
||||
/*
|
||||
* We cannot clone this object, so fail (we used to return funobj, bad
|
||||
* idea, but we changed incompatibly to teach any abusers a lesson!).
|
||||
|
@ -4238,7 +4238,7 @@ JS_GetFunctionArity(JSFunction *fun)
|
|||
JS_PUBLIC_API(JSBool)
|
||||
JS_ObjectIsFunction(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
return OBJ_GET_CLASS(cx, obj) == &js_FunctionClass;
|
||||
return obj->getClass() == &js_FunctionClass;
|
||||
}
|
||||
|
||||
JS_BEGIN_EXTERN_C
|
||||
|
|
|
@ -128,7 +128,7 @@ INDEX_TOO_BIG(jsuint index)
|
|||
JS_STATIC_ASSERT(sizeof(JSScopeProperty) > 4 * sizeof(jsval));
|
||||
|
||||
#define ENSURE_SLOW_ARRAY(cx, obj) \
|
||||
(OBJ_GET_CLASS(cx, obj) == &js_SlowArrayClass || js_MakeArraySlow(cx, obj))
|
||||
(obj->getClass() == &js_SlowArrayClass || js_MakeArraySlow(cx, obj))
|
||||
|
||||
/*
|
||||
* Determine if the id represents an array index or an XML property index.
|
||||
|
@ -298,7 +298,7 @@ BigIndexToId(JSContext *cx, JSObject *obj, jsuint index, JSBool createAtom,
|
|||
* in any case.
|
||||
*/
|
||||
if (!createAtom &&
|
||||
((clasp = OBJ_GET_CLASS(cx, obj)) == &js_SlowArrayClass ||
|
||||
((clasp = obj->getClass()) == &js_SlowArrayClass ||
|
||||
clasp == &js_ArgumentsClass ||
|
||||
clasp == &js_ObjectClass)) {
|
||||
atom = js_GetExistingStringAtom(cx, start, JS_ARRAY_END(buf) - start);
|
||||
|
@ -1378,7 +1378,7 @@ array_toSource(JSContext *cx, uintN argc, jsval *vp)
|
|||
|
||||
JSObject *obj = JS_THIS_OBJECT(cx, vp);
|
||||
if (!obj ||
|
||||
(OBJ_GET_CLASS(cx, obj) != &js_SlowArrayClass &&
|
||||
(obj->getClass() != &js_SlowArrayClass &&
|
||||
!JS_InstanceOf(cx, obj, &js_ArrayClass, vp + 2))) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1584,7 +1584,7 @@ array_toString(JSContext *cx, uintN argc, jsval *vp)
|
|||
|
||||
obj = JS_THIS_OBJECT(cx, vp);
|
||||
if (!obj ||
|
||||
(OBJ_GET_CLASS(cx, obj) != &js_SlowArrayClass &&
|
||||
(obj->getClass() != &js_SlowArrayClass &&
|
||||
!JS_InstanceOf(cx, obj, &js_ArrayClass, vp + 2))) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
@ -1599,7 +1599,7 @@ array_toLocaleString(JSContext *cx, uintN argc, jsval *vp)
|
|||
|
||||
obj = JS_THIS_OBJECT(cx, vp);
|
||||
if (!obj ||
|
||||
(OBJ_GET_CLASS(cx, obj) != &js_SlowArrayClass &&
|
||||
(obj->getClass() != &js_SlowArrayClass &&
|
||||
!JS_InstanceOf(cx, obj, &js_ArrayClass, vp + 2))) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ js_AddProperty(JSContext* cx, JSObject* obj, JSScopeProperty* sprop)
|
|||
}
|
||||
|
||||
if (!scope->table) {
|
||||
if (slot < obj->numSlots() && !OBJ_GET_CLASS(cx, obj)->reserveSlots) {
|
||||
if (slot < obj->numSlots() && !obj->getClass()->reserveSlots) {
|
||||
JS_ASSERT(JSVAL_IS_VOID(obj->getSlot(scope->freeslot)));
|
||||
++scope->freeslot;
|
||||
} else {
|
||||
|
@ -260,7 +260,7 @@ HasProperty(JSContext* cx, JSObject* obj, jsid id)
|
|||
for (JSObject* pobj = obj; pobj; pobj = pobj->getProto()) {
|
||||
if (pobj->map->ops->lookupProperty != js_LookupProperty)
|
||||
return JSVAL_TO_SPECIAL(JSVAL_VOID);
|
||||
JSClass* clasp = OBJ_GET_CLASS(cx, pobj);
|
||||
JSClass* clasp = pobj->getClass();
|
||||
if (clasp->resolve != JS_ResolveStub && clasp != &js_StringClass)
|
||||
return JSVAL_TO_SPECIAL(JSVAL_VOID);
|
||||
}
|
||||
|
|
|
@ -1216,7 +1216,7 @@ GetUTCTime(JSContext *cx, JSObject *obj, jsval *vp, jsdouble *dp)
|
|||
static void
|
||||
SetDateToNaN(JSContext *cx, JSObject *obj, jsval *vp = NULL)
|
||||
{
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_DateClass);
|
||||
JS_ASSERT(obj->getClass() == &js_DateClass);
|
||||
|
||||
obj->fslots[JSSLOT_LOCAL_TIME] = cx->runtime->NaNValue;
|
||||
obj->fslots[JSSLOT_UTC_TIME] = cx->runtime->NaNValue;
|
||||
|
@ -1230,7 +1230,7 @@ SetDateToNaN(JSContext *cx, JSObject *obj, jsval *vp = NULL)
|
|||
static JSBool
|
||||
SetUTCTime(JSContext *cx, JSObject *obj, jsdouble t, jsval *vp = NULL)
|
||||
{
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_DateClass);
|
||||
JS_ASSERT(obj->getClass() == &js_DateClass);
|
||||
|
||||
obj->fslots[JSSLOT_LOCAL_TIME] = cx->runtime->NaNValue;
|
||||
if (!js_NewDoubleInRootedValue(cx, t, &obj->fslots[JSSLOT_UTC_TIME]))
|
||||
|
|
|
@ -658,7 +658,7 @@ js_watch_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
JSFrameRegs regs;
|
||||
|
||||
closure = wp->closure;
|
||||
clasp = OBJ_GET_CLASS(cx, closure);
|
||||
clasp = closure->getClass();
|
||||
if (clasp == &js_FunctionClass) {
|
||||
fun = GET_FUNCTION_PRIVATE(cx, closure);
|
||||
script = FUN_SCRIPT(fun);
|
||||
|
@ -848,7 +848,7 @@ JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsval idval,
|
|||
|
||||
if (!obj->isNative()) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CANT_WATCH,
|
||||
OBJ_GET_CLASS(cx, obj)->name);
|
||||
obj->getClass()->name);
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1500,7 +1500,7 @@ JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda)
|
|||
JSPropertyDesc *pd;
|
||||
JSScopeProperty *sprop;
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (!obj->isNative() || (clasp->flags & JSCLASS_NEW_ENUMERATE)) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
|
||||
JSMSG_CANT_DESCRIBE_PROPS, clasp->name);
|
||||
|
|
|
@ -260,7 +260,7 @@ InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
|
|||
JSStackTraceElem *elem;
|
||||
jsval *values;
|
||||
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, exnObject) == &js_ErrorClass);
|
||||
JS_ASSERT(exnObject->getClass() == &js_ErrorClass);
|
||||
|
||||
/*
|
||||
* Prepare stack trace data.
|
||||
|
@ -511,7 +511,7 @@ js_ErrorFromException(JSContext *cx, jsval exn)
|
|||
if (JSVAL_IS_PRIMITIVE(exn))
|
||||
return NULL;
|
||||
obj = JSVAL_TO_OBJECT(exn);
|
||||
if (OBJ_GET_CLASS(cx, obj) != &js_ErrorClass)
|
||||
if (obj->getClass() != &js_ErrorClass)
|
||||
return NULL;
|
||||
priv = GetExnPrivate(cx, obj);
|
||||
if (!priv)
|
||||
|
@ -547,7 +547,7 @@ ValueToShortSource(JSContext *cx, jsval v)
|
|||
*/
|
||||
char buf[100];
|
||||
JS_snprintf(buf, sizeof buf, "[object %s]",
|
||||
OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(v))->name);
|
||||
JSVAL_TO_OBJECT(v)->getClass()->name);
|
||||
str = JS_NewStringCopyZ(cx, buf);
|
||||
}
|
||||
return str;
|
||||
|
@ -713,7 +713,7 @@ Exception(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
* If it's a new object of class Exception, then null out the private
|
||||
* data so that the finalizer doesn't attempt to free it.
|
||||
*/
|
||||
if (OBJ_GET_CLASS(cx, obj) == &js_ErrorClass)
|
||||
if (obj->getClass() == &js_ErrorClass)
|
||||
obj->setPrivate(NULL);
|
||||
|
||||
/* Set the 'message' property. */
|
||||
|
@ -755,7 +755,7 @@ Exception(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
lineno = (fp && fp->regs) ? js_FramePCToLineNumber(cx, fp) : 0;
|
||||
}
|
||||
|
||||
return (OBJ_GET_CLASS(cx, obj) != &js_ErrorClass) ||
|
||||
return (obj->getClass() != &js_ErrorClass) ||
|
||||
InitExnPrivate(cx, obj, message, filename, lineno, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -809,7 +809,7 @@ js_GetCallObject(JSContext *cx, JSStackFrame *fp)
|
|||
|
||||
#ifdef DEBUG
|
||||
/* A call object should be a frame's outermost scope chain element. */
|
||||
JSClass *classp = OBJ_GET_CLASS(cx, fp->scopeChain);
|
||||
JSClass *classp = fp->scopeChain->getClass();
|
||||
if (classp == &js_WithClass || classp == &js_BlockClass || classp == &js_CallClass)
|
||||
JS_ASSERT(fp->scopeChain->getPrivate() != fp);
|
||||
#endif
|
||||
|
@ -1914,8 +1914,7 @@ fun_toStringHelper(JSContext *cx, uint32 indent, uintN argc, jsval *vp)
|
|||
*/
|
||||
if (!JSVAL_IS_PRIMITIVE(fval)) {
|
||||
obj = JSVAL_TO_OBJECT(fval);
|
||||
if (!OBJ_GET_CLASS(cx, obj)->convert(cx, obj, JSTYPE_FUNCTION,
|
||||
&fval)) {
|
||||
if (!obj->getClass()->convert(cx, obj, JSTYPE_FUNCTION, &fval)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
vp[1] = fval;
|
||||
|
@ -2639,7 +2638,7 @@ js_ValueToFunction(JSContext *cx, jsval *vp, uintN flags)
|
|||
obj = NULL;
|
||||
if (JSVAL_IS_OBJECT(v)) {
|
||||
obj = JSVAL_TO_OBJECT(v);
|
||||
if (obj && OBJ_GET_CLASS(cx, obj) != &js_FunctionClass) {
|
||||
if (obj && obj->getClass() != &js_FunctionClass) {
|
||||
if (!obj->defaultValue(cx, JSTYPE_FUNCTION, &v))
|
||||
return NULL;
|
||||
obj = VALUE_IS_FUNCTION(cx, v) ? JSVAL_TO_OBJECT(v) : NULL;
|
||||
|
|
|
@ -260,7 +260,7 @@ js_GetScopeChain(JSContext *cx, JSStackFrame *fp)
|
|||
*/
|
||||
JSObject *limitBlock, *limitClone;
|
||||
if (fp->fun && !fp->callobj) {
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, fp->scopeChain) != &js_BlockClass ||
|
||||
JS_ASSERT(fp->scopeChain->getClass() != &js_BlockClass ||
|
||||
fp->scopeChain->getPrivate() != fp);
|
||||
if (!js_GetCallObject(cx, fp))
|
||||
return NULL;
|
||||
|
@ -275,7 +275,7 @@ js_GetScopeChain(JSContext *cx, JSStackFrame *fp)
|
|||
* to, but not including, that prototype.
|
||||
*/
|
||||
limitClone = fp->scopeChain;
|
||||
while (OBJ_GET_CLASS(cx, limitClone) == &js_WithClass)
|
||||
while (limitClone->getClass() == &js_WithClass)
|
||||
limitClone = limitClone->getParent();
|
||||
JS_ASSERT(limitClone);
|
||||
|
||||
|
@ -346,7 +346,7 @@ js_GetScopeChain(JSContext *cx, JSStackFrame *fp)
|
|||
* found it in blockChain.
|
||||
*/
|
||||
JS_ASSERT_IF(limitBlock &&
|
||||
OBJ_GET_CLASS(cx, limitBlock) == &js_BlockClass &&
|
||||
limitBlock->getClass() == &js_BlockClass &&
|
||||
limitClone->getPrivate() == fp,
|
||||
sharedBlock);
|
||||
|
||||
|
@ -427,7 +427,7 @@ ComputeThis(JSContext *cx, jsval *argv)
|
|||
}
|
||||
|
||||
thisp = JSVAL_TO_OBJECT(argv[-1]);
|
||||
if (OBJ_GET_CLASS(cx, thisp) == &js_CallClass || OBJ_GET_CLASS(cx, thisp) == &js_BlockClass)
|
||||
if (thisp->getClass() == &js_CallClass || thisp->getClass() == &js_BlockClass)
|
||||
return js_ComputeGlobalThis(cx, argv);
|
||||
|
||||
return CallThisObjectHook(cx, thisp, argv);
|
||||
|
@ -1312,7 +1312,7 @@ js_InvokeConstructor(JSContext *cx, uintN argc, JSBool clampReturn, jsval *vp)
|
|||
if (!JSVAL_IS_OBJECT(lval) ||
|
||||
(obj2 = JSVAL_TO_OBJECT(lval)) == NULL ||
|
||||
/* XXX clean up to avoid special cases above ObjectOps layer */
|
||||
OBJ_GET_CLASS(cx, obj2) == &js_FunctionClass ||
|
||||
obj2->getClass() == &js_FunctionClass ||
|
||||
!obj2->map->ops->construct)
|
||||
{
|
||||
fun = js_ValueToFunction(cx, vp, JSV2F_CONSTRUCT);
|
||||
|
@ -1440,7 +1440,7 @@ js_LeaveWith(JSContext *cx)
|
|||
JSObject *withobj;
|
||||
|
||||
withobj = cx->fp->scopeChain;
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, withobj) == &js_WithClass);
|
||||
JS_ASSERT(withobj->getClass() == &js_WithClass);
|
||||
JS_ASSERT(withobj->getPrivate() == cx->fp);
|
||||
JS_ASSERT(OBJ_BLOCK_DEPTH(cx, withobj) >= 0);
|
||||
cx->fp->scopeChain = withobj->getParent();
|
||||
|
@ -1452,7 +1452,7 @@ js_IsActiveWithOrBlock(JSContext *cx, JSObject *obj, int stackDepth)
|
|||
{
|
||||
JSClass *clasp;
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if ((clasp == &js_WithClass || clasp == &js_BlockClass) &&
|
||||
obj->getPrivate() == cx->fp &&
|
||||
OBJ_BLOCK_DEPTH(cx, obj) >= stackDepth) {
|
||||
|
@ -1476,7 +1476,7 @@ js_UnwindScope(JSContext *cx, JSStackFrame *fp, jsint stackDepth,
|
|||
JS_ASSERT(StackBase(fp) + stackDepth <= fp->regs->sp);
|
||||
|
||||
for (obj = fp->blockChain; obj; obj = obj->getParent()) {
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_BlockClass);
|
||||
JS_ASSERT(obj->getClass() == &js_BlockClass);
|
||||
if (OBJ_BLOCK_DEPTH(cx, obj) < stackDepth)
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ static JSFunctionSpec iterator_methods[] = {
|
|||
uintN
|
||||
js_GetNativeIteratorFlags(JSContext *cx, JSObject *iterobj)
|
||||
{
|
||||
if (OBJ_GET_CLASS(cx, iterobj) != &js_IteratorClass)
|
||||
if (iterobj->getClass() != &js_IteratorClass)
|
||||
return 0;
|
||||
return JSVAL_TO_INT(iterobj->getSlot(JSSLOT_ITER_FLAGS));
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ js_ValueToIterator(JSContext *cx, uintN flags, jsval *vp)
|
|||
|
||||
tvr.setObject(obj);
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if ((clasp->flags & JSCLASS_IS_EXTENDED) &&
|
||||
(xclasp = (JSExtendedClass *) clasp)->iteratorObject) {
|
||||
iterobj = xclasp->iteratorObject(cx, obj, !(flags & JSITER_FOREACH));
|
||||
|
@ -430,7 +430,7 @@ js_CloseIterator(JSContext *cx, jsval v)
|
|||
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(v));
|
||||
obj = JSVAL_TO_OBJECT(v);
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
|
||||
if (clasp == &js_IteratorClass) {
|
||||
js_CloseNativeIterator(cx, obj);
|
||||
|
@ -539,7 +539,7 @@ CallEnumeratorNext(JSContext *cx, JSObject *iterobj, uintN flags, jsval *rval)
|
|||
*/
|
||||
if (obj != obj2) {
|
||||
cond = JS_FALSE;
|
||||
clasp = OBJ_GET_CLASS(cx, obj2);
|
||||
clasp = obj2->getClass();
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
xclasp = (JSExtendedClass *) clasp;
|
||||
cond = xclasp->outerObject &&
|
||||
|
@ -582,7 +582,7 @@ js_CallIteratorNext(JSContext *cx, JSObject *iterobj, jsval *rval)
|
|||
uintN flags;
|
||||
|
||||
/* Fast path for native iterators */
|
||||
if (OBJ_GET_CLASS(cx, iterobj) == &js_IteratorClass) {
|
||||
if (iterobj->getClass() == &js_IteratorClass) {
|
||||
flags = JSVAL_TO_INT(iterobj->getSlot(JSSLOT_ITER_FLAGS));
|
||||
if (flags & JSITER_ENUMERATE)
|
||||
return CallEnumeratorNext(cx, iterobj, flags, rval);
|
||||
|
|
|
@ -182,7 +182,7 @@ obj_getSlot(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
pobj = JSVAL_TO_OBJECT(*vp);
|
||||
if (pobj) {
|
||||
clasp = OBJ_GET_CLASS(cx, pobj);
|
||||
clasp = pobj->getClass();
|
||||
if (clasp == &js_CallClass || clasp == &js_BlockClass) {
|
||||
/* Censor activations and lexical scopes per ECMA-262. */
|
||||
*vp = JSVAL_NULL;
|
||||
|
@ -1021,7 +1021,7 @@ obj_toString(JSContext *cx, uintN argc, jsval *vp)
|
|||
if (!obj)
|
||||
return JS_FALSE;
|
||||
obj = js_GetWrappedObject(cx, obj);
|
||||
clazz = OBJ_GET_CLASS(cx, obj)->name;
|
||||
clazz = obj->getClass()->name;
|
||||
nchars = 9 + strlen(clazz); /* 9 for "[object ]" */
|
||||
chars = (jschar *) cx->malloc((nchars + 1) * sizeof(jschar));
|
||||
if (!chars)
|
||||
|
@ -1143,7 +1143,7 @@ js_CheckScopeChainValidity(JSContext *cx, JSObject *scopeobj, const char *caller
|
|||
|
||||
/* XXX This is an awful gross hack. */
|
||||
while (scopeobj) {
|
||||
clasp = OBJ_GET_CLASS(cx, scopeobj);
|
||||
clasp = scopeobj->getClass();
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
xclasp = (JSExtendedClass*)clasp;
|
||||
if (xclasp->innerObject &&
|
||||
|
@ -2785,7 +2785,7 @@ InitScopeForObject(JSContext* cx, JSObject* obj, JSObject* proto, JSObjectOps* o
|
|||
JS_ASSERT(proto == obj->getProto());
|
||||
|
||||
/* Share proto's emptyScope only if obj is similar to proto. */
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clasp = obj->getClass();
|
||||
JSScope *scope = NULL;
|
||||
|
||||
if (proto && proto->isNative()) {
|
||||
|
@ -3379,7 +3379,7 @@ js_PutBlockObject(JSContext *cx, JSBool normalUnwind)
|
|||
|
||||
fp = cx->fp;
|
||||
obj = fp->scopeChain;
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_BlockClass);
|
||||
JS_ASSERT(obj->getClass() == &js_BlockClass);
|
||||
JS_ASSERT(obj->getPrivate() == cx->fp);
|
||||
JS_ASSERT(OBJ_IS_CLONED_BLOCK(obj));
|
||||
|
||||
|
@ -3703,7 +3703,7 @@ js_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
|
|||
* and (c) key is not the null key.
|
||||
*/
|
||||
if ((clasp->flags & JSCLASS_IS_ANONYMOUS) &&
|
||||
(OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL) &&
|
||||
(obj->getClass()->flags & JSCLASS_IS_GLOBAL) &&
|
||||
key != JSProto_Null) {
|
||||
named = JS_FALSE;
|
||||
} else {
|
||||
|
@ -3755,7 +3755,7 @@ js_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
|
|||
}
|
||||
|
||||
/* Bootstrap Function.prototype (see also JS_InitStandardClasses). */
|
||||
if (OBJ_GET_CLASS(cx, ctor) == clasp)
|
||||
if (ctor->getClass() == clasp)
|
||||
ctor->setProto(proto);
|
||||
}
|
||||
|
||||
|
@ -3956,7 +3956,7 @@ js_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key,
|
|||
|
||||
while ((tmp = obj->getParent()) != NULL)
|
||||
obj = tmp;
|
||||
if (!(OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL)) {
|
||||
if (!(obj->getClass()->flags & JSCLASS_IS_GLOBAL)) {
|
||||
*objp = NULL;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -4001,7 +4001,7 @@ JSBool
|
|||
js_SetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject *cobj)
|
||||
{
|
||||
JS_ASSERT(!obj->getParent());
|
||||
if (!(OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL))
|
||||
if (!(obj->getClass()->flags & JSCLASS_IS_GLOBAL))
|
||||
return JS_TRUE;
|
||||
|
||||
return JS_SetReservedSlot(cx, obj, key, OBJECT_TO_JSVAL(cobj));
|
||||
|
@ -4138,7 +4138,7 @@ js_ConstructObject(JSContext *cx, JSClass *clasp, JSObject *proto,
|
|||
* we should throw a type error.
|
||||
*/
|
||||
obj = JSVAL_TO_OBJECT(rval);
|
||||
if (OBJ_GET_CLASS(cx, obj) != clasp ||
|
||||
if (obj->getClass() != clasp ||
|
||||
(!(~clasp->flags & (JSCLASS_HAS_PRIVATE |
|
||||
JSCLASS_CONSTRUCT_PROTOTYPE)) &&
|
||||
!obj->getPrivate())) {
|
||||
|
@ -4710,7 +4710,7 @@ js_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, jsid id, uintN flags,
|
|||
* that is really just a memory-saving hack, safe because Blocks cannot
|
||||
* be on the prototype chain of other objects.
|
||||
*/
|
||||
JS_ASSERT_IF(OBJ_GET_CLASS(cx, obj) != &js_BlockClass,
|
||||
JS_ASSERT_IF(obj->getClass() != &js_BlockClass,
|
||||
OBJ_SCOPE(obj) != OBJ_SCOPE(proto));
|
||||
|
||||
obj = proto;
|
||||
|
@ -4752,9 +4752,9 @@ js_FindPropertyHelper(JSContext *cx, jsid id, JSBool cacheResult,
|
|||
if (prop) {
|
||||
#ifdef DEBUG
|
||||
if (parent) {
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clasp = obj->getClass();
|
||||
JS_ASSERT(pobj->isNative());
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, pobj) == clasp);
|
||||
JS_ASSERT(pobj->getClass() == clasp);
|
||||
if (clasp == &js_BlockClass) {
|
||||
/*
|
||||
* A block instance on the scope chain is immutable and
|
||||
|
@ -4854,7 +4854,7 @@ js_FindIdentifierBase(JSContext *cx, JSObject *scopeChain, jsid id)
|
|||
if (prop) {
|
||||
JS_ASSERT(pobj->isNative());
|
||||
JS_ASSERT(!obj->getParent() ||
|
||||
OBJ_GET_CLASS(cx, pobj) == OBJ_GET_CLASS(cx, obj));
|
||||
pobj->getClass() == obj->getClass());
|
||||
#ifdef DEBUG
|
||||
PropertyCacheEntry *entry =
|
||||
#endif
|
||||
|
@ -5028,7 +5028,7 @@ js_GetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, uintN getHow,
|
|||
if (!prop) {
|
||||
*vp = JSVAL_VOID;
|
||||
|
||||
if (!OBJ_GET_CLASS(cx, obj)->getProperty(cx, obj, ID_TO_VALUE(id), vp))
|
||||
if (!obj->getClass()->getProperty(cx, obj, ID_TO_VALUE(id), vp))
|
||||
return JS_FALSE;
|
||||
|
||||
PCMETER(getHow & JSGET_CACHE_RESULT && JS_PROPERTY_CACHE(cx).nofills++);
|
||||
|
@ -5206,7 +5206,7 @@ js_SetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, uintN defineHow,
|
|||
}
|
||||
} else {
|
||||
/* We should never add properties to lexical blocks. */
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, obj) != &js_BlockClass);
|
||||
JS_ASSERT(obj->getClass() != &js_BlockClass);
|
||||
|
||||
if (!obj->getParent() && !js_CheckUndeclaredVarAssignment(cx))
|
||||
return JS_FALSE;
|
||||
|
@ -5224,7 +5224,7 @@ js_SetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, uintN defineHow,
|
|||
attrs = JSPROP_ENUMERATE;
|
||||
flags = 0;
|
||||
shortid = 0;
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
getter = clasp->getProperty;
|
||||
setter = clasp->setProperty;
|
||||
|
||||
|
@ -5501,8 +5501,7 @@ js_DeleteProperty(JSContext *cx, JSObject *obj, jsid id, jsval *rval)
|
|||
* a prototype, call the class's delProperty hook, passing rval as the
|
||||
* result parameter.
|
||||
*/
|
||||
return OBJ_GET_CLASS(cx, obj)->delProperty(cx, obj, ID_TO_VALUE(id),
|
||||
rval);
|
||||
return obj->getClass()->delProperty(cx, obj, ID_TO_VALUE(id), rval);
|
||||
}
|
||||
|
||||
sprop = (JSScopeProperty *)prop;
|
||||
|
@ -5541,7 +5540,7 @@ js_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp)
|
|||
* new String(...) instances whether mutated to have their own scope or
|
||||
* not, as well as direct String.prototype references.
|
||||
*/
|
||||
if (OBJ_GET_CLASS(cx, obj) == &js_StringClass) {
|
||||
if (obj->getClass() == &js_StringClass) {
|
||||
jsid toStringId = ATOM_TO_JSID(cx->runtime->atomState.toStringAtom);
|
||||
|
||||
JS_LOCK_OBJ(cx, obj);
|
||||
|
@ -5552,7 +5551,7 @@ js_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp)
|
|||
if (!sprop) {
|
||||
pobj = obj->getProto();
|
||||
|
||||
if (pobj && OBJ_GET_CLASS(cx, pobj) == &js_StringClass) {
|
||||
if (pobj && pobj->getClass() == &js_StringClass) {
|
||||
JS_UNLOCK_SCOPE(cx, scope);
|
||||
JS_LOCK_OBJ(cx, pobj);
|
||||
scope = OBJ_SCOPE(pobj);
|
||||
|
@ -5587,13 +5586,13 @@ js_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp)
|
|||
}
|
||||
|
||||
if (!JSVAL_IS_PRIMITIVE(v)) {
|
||||
if (!OBJ_GET_CLASS(cx, obj)->convert(cx, obj, hint, &v))
|
||||
if (!obj->getClass()->convert(cx, obj, hint, &v))
|
||||
return JS_FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!OBJ_GET_CLASS(cx, obj)->convert(cx, obj, hint, &v))
|
||||
if (!obj->getClass()->convert(cx, obj, hint, &v))
|
||||
return JS_FALSE;
|
||||
if (!JSVAL_IS_PRIMITIVE(v)) {
|
||||
JSType type = JS_TypeOfValue(cx, v);
|
||||
|
@ -5611,7 +5610,7 @@ js_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp)
|
|||
if (!JSVAL_IS_PRIMITIVE(v)) {
|
||||
/* Avoid recursive death when decompiling in js_ReportValueError. */
|
||||
if (hint == JSTYPE_STRING) {
|
||||
str = JS_InternString(cx, OBJ_GET_CLASS(cx, obj)->name);
|
||||
str = JS_InternString(cx, obj->getClass()->name);
|
||||
if (!str)
|
||||
return JS_FALSE;
|
||||
} else {
|
||||
|
@ -5962,7 +5961,7 @@ js_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,
|
|||
* checkObjectAccess hook. This covers precompilation-based sharing and
|
||||
* (possibly unintended) runtime sharing across trust boundaries.
|
||||
*/
|
||||
clasp = OBJ_GET_CLASS(cx, pobj);
|
||||
clasp = pobj->getClass();
|
||||
check = clasp->checkAccess;
|
||||
if (!check) {
|
||||
callbacks = JS_GetSecurityCallbacks(cx);
|
||||
|
@ -6043,7 +6042,7 @@ js_Call(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
{
|
||||
JSClass *clasp;
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(argv[-2]));
|
||||
clasp = JSVAL_TO_OBJECT(argv[-2])->getClass();
|
||||
if (!clasp->call) {
|
||||
#ifdef NARCISSUS
|
||||
JSObject *callee, *args;
|
||||
|
@ -6082,7 +6081,7 @@ js_Construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
{
|
||||
JSClass *clasp;
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(argv[-2]));
|
||||
clasp = JSVAL_TO_OBJECT(argv[-2])->getClass();
|
||||
if (!clasp->construct) {
|
||||
#ifdef NARCISSUS
|
||||
JSObject *callee, *args;
|
||||
|
@ -6121,7 +6120,7 @@ js_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp)
|
|||
{
|
||||
JSClass *clasp;
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp->hasInstance)
|
||||
return clasp->hasInstance(cx, obj, v, bp);
|
||||
#ifdef NARCISSUS
|
||||
|
@ -6409,7 +6408,7 @@ js_XDRObject(JSXDRState *xdr, JSObject **objp)
|
|||
cx = xdr->cx;
|
||||
atom = NULL;
|
||||
if (xdr->mode == JSXDR_ENCODE) {
|
||||
clasp = OBJ_GET_CLASS(cx, *objp);
|
||||
clasp = (*objp)->getClass();
|
||||
classId = JS_XDRFindClassIdByName(xdr, clasp->name);
|
||||
classDef = !classId;
|
||||
if (classDef) {
|
||||
|
@ -6451,7 +6450,7 @@ js_XDRObject(JSXDRState *xdr, JSObject **objp)
|
|||
protoKey = (JSProtoKey) (classDef >> 1);
|
||||
if (!js_GetClassPrototype(cx, NULL, protoKey, &proto, clasp))
|
||||
return JS_FALSE;
|
||||
clasp = OBJ_GET_CLASS(cx, proto);
|
||||
clasp = proto->getClass();
|
||||
if (!JS_XDRRegisterClass(xdr, clasp, &classId))
|
||||
return JS_FALSE;
|
||||
} else {
|
||||
|
@ -6693,7 +6692,7 @@ js_SetReservedSlot(JSContext *cx, JSObject *obj, uint32 index, jsval v)
|
|||
if (!obj->isNative())
|
||||
return true;
|
||||
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clasp = obj->getClass();
|
||||
uint32 limit = JSCLASS_RESERVED_SLOTS(clasp);
|
||||
|
||||
JS_LOCK_OBJ(cx, obj);
|
||||
|
@ -6740,7 +6739,7 @@ js_GetWrappedObject(JSContext *cx, JSObject *obj)
|
|||
{
|
||||
JSClass *clasp;
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp;
|
||||
JSObject *obj2;
|
||||
|
|
|
@ -558,17 +558,11 @@ struct JSObject {
|
|||
|
||||
#endif /* JS_THREADSAFE */
|
||||
|
||||
/*
|
||||
* Class is invariant and comes from the fixed clasp member. Thus no locking
|
||||
* is necessary to read it. Same for the private slot.
|
||||
*/
|
||||
#define OBJ_GET_CLASS(cx,obj) (obj)->getClass()
|
||||
|
||||
#ifdef __cplusplus
|
||||
inline void
|
||||
OBJ_TO_INNER_OBJECT(JSContext *cx, JSObject *&obj)
|
||||
{
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clasp = obj->getClass();
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp = (JSExtendedClass *) clasp;
|
||||
if (xclasp->innerObject)
|
||||
|
@ -583,7 +577,7 @@ OBJ_TO_INNER_OBJECT(JSContext *cx, JSObject *&obj)
|
|||
inline void
|
||||
OBJ_TO_OUTER_OBJECT(JSContext *cx, JSObject *&obj)
|
||||
{
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clasp = obj->getClass();
|
||||
if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp = (JSExtendedClass *) clasp;
|
||||
if (xclasp->outerObject)
|
||||
|
|
|
@ -449,7 +449,7 @@ Str(JSContext *cx, jsid id, JSObject *holder, StringifyContext *scx, jsval *vp,
|
|||
|
||||
// catches string and number objects with no toJSON
|
||||
if (!JSVAL_IS_PRIMITIVE(*vp)) {
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(*vp));
|
||||
JSClass *clasp = JSVAL_TO_OBJECT(*vp)->getClass();
|
||||
if (clasp == &js_StringClass || clasp == &js_NumberClass)
|
||||
*vp = JSVAL_TO_OBJECT(*vp)->fslots[JSSLOT_PRIMITIVE_THIS];
|
||||
}
|
||||
|
@ -515,7 +515,7 @@ InitializeGap(JSContext *cx, jsval space, JSCharBuffer &cb)
|
|||
|
||||
if (!JSVAL_IS_PRIMITIVE(space)) {
|
||||
JSObject *obj = JSVAL_TO_OBJECT(space);
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clasp = obj->getClass();
|
||||
if (clasp == &js_NumberClass || clasp == &js_StringClass)
|
||||
*gap.addr() = obj->fslots[JSSLOT_PRIMITIVE_THIS];
|
||||
}
|
||||
|
|
|
@ -275,7 +275,7 @@ ToDisassemblySource(JSContext *cx, jsval v)
|
|||
{
|
||||
if (!JSVAL_IS_PRIMITIVE(v)) {
|
||||
JSObject *obj = JSVAL_TO_OBJECT(v);
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clasp = obj->getClass();
|
||||
|
||||
if (clasp == &js_BlockClass) {
|
||||
char *source = JS_sprintf_append(NULL, "depth %d {", OBJ_BLOCK_DEPTH(cx, obj));
|
||||
|
@ -1315,7 +1315,7 @@ GetLocal(SprintStack *ss, jsint i)
|
|||
if (j == n)
|
||||
return GetStr(ss, i);
|
||||
obj = script->getObject(j);
|
||||
if (OBJ_GET_CLASS(cx, obj) == &js_BlockClass) {
|
||||
if (obj->getClass() == &js_BlockClass) {
|
||||
depth = OBJ_BLOCK_DEPTH(cx, obj);
|
||||
count = OBJ_BLOCK_COUNT(cx, obj);
|
||||
if ((jsuint)(i - depth) < (jsuint)count)
|
||||
|
@ -4190,7 +4190,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
|
|||
|
||||
case JSOP_OBJECT:
|
||||
LOAD_OBJECT(0);
|
||||
LOCAL_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_RegExpClass);
|
||||
LOCAL_ASSERT(obj->getClass() == &js_RegExpClass);
|
||||
goto do_regexp;
|
||||
|
||||
case JSOP_REGEXP:
|
||||
|
|
|
@ -145,7 +145,7 @@ BEGIN_CASE(JSOP_POPN)
|
|||
OBJ_BLOCK_DEPTH(cx, obj) + OBJ_BLOCK_COUNT(cx, obj)
|
||||
<= (size_t) (regs.sp - StackBase(fp)));
|
||||
for (obj = fp->scopeChain; obj; obj = obj->getParent()) {
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp != &js_BlockClass && clasp != &js_WithClass)
|
||||
continue;
|
||||
if (obj->getPrivate() != fp)
|
||||
|
@ -799,7 +799,7 @@ END_CASE(JSOP_BITAND)
|
|||
#define EXTENDED_EQUALITY_OP(OP) \
|
||||
if (ltmp == JSVAL_OBJECT && \
|
||||
(obj2 = JSVAL_TO_OBJECT(lval)) && \
|
||||
((clasp = OBJ_GET_CLASS(cx, obj2))->flags & JSCLASS_IS_EXTENDED)) { \
|
||||
((clasp = obj2->getClass())->flags & JSCLASS_IS_EXTENDED)) { \
|
||||
JSExtendedClass *xclasp; \
|
||||
\
|
||||
xclasp = (JSExtendedClass *) clasp; \
|
||||
|
@ -1765,7 +1765,7 @@ BEGIN_CASE(JSOP_SETMETHOD)
|
|||
* slots that may vary with obj.
|
||||
*/
|
||||
if (slot < obj->numSlots() &&
|
||||
!OBJ_GET_CLASS(cx, obj)->reserveSlots) {
|
||||
!obj->getClass()->reserveSlots) {
|
||||
++scope->freeslot;
|
||||
} else {
|
||||
if (!js_AllocSlot(cx, obj, &slot))
|
||||
|
@ -2980,7 +2980,7 @@ BEGIN_CASE(JSOP_DEFFUN)
|
|||
JS_ASSERT_IF(doSet, fp->flags & JSFRAME_EVAL);
|
||||
if (prop) {
|
||||
if (parent == pobj &&
|
||||
OBJ_GET_CLASS(cx, parent) == &js_CallClass &&
|
||||
parent->getClass() == &js_CallClass &&
|
||||
(old = ((JSScopeProperty *) prop)->attributes(),
|
||||
!(old & (JSPROP_GETTER|JSPROP_SETTER)) &&
|
||||
(old & (JSPROP_ENUMERATE|JSPROP_PERMANENT)) == attrs)) {
|
||||
|
@ -3143,14 +3143,14 @@ BEGIN_CASE(JSOP_LAMBDA)
|
|||
lval = FETCH_OPND(-1);
|
||||
if (JSVAL_IS_OBJECT(lval) &&
|
||||
(obj2 = JSVAL_TO_OBJECT(lval)) &&
|
||||
OBJ_GET_CLASS(cx, obj2) == &js_ObjectClass) {
|
||||
obj2->getClass() == &js_ObjectClass) {
|
||||
break;
|
||||
}
|
||||
} else if (op == JSOP_INITMETHOD) {
|
||||
lval = FETCH_OPND(-1);
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(lval));
|
||||
obj2 = JSVAL_TO_OBJECT(lval);
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, obj2) == &js_ObjectClass);
|
||||
JS_ASSERT(obj2->getClass() == &js_ObjectClass);
|
||||
JS_ASSERT(OBJ_SCOPE(obj2)->object == obj2);
|
||||
break;
|
||||
}
|
||||
|
@ -3361,7 +3361,7 @@ BEGIN_CASE(JSOP_INITMETHOD)
|
|||
lval = FETCH_OPND(-2);
|
||||
obj = JSVAL_TO_OBJECT(lval);
|
||||
JS_ASSERT(obj->isNative());
|
||||
JS_ASSERT(!OBJ_GET_CLASS(cx, obj)->reserveSlots);
|
||||
JS_ASSERT(!obj->getClass()->reserveSlots);
|
||||
JS_ASSERT(!(obj->getClass()->flags & JSCLASS_SHARE_ALL_PROPERTIES));
|
||||
|
||||
JSScope *scope = OBJ_SCOPE(obj);
|
||||
|
@ -3987,7 +3987,7 @@ BEGIN_CASE(JSOP_LEAVEBLOCKEXPR)
|
|||
BEGIN_CASE(JSOP_LEAVEBLOCK)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, fp->blockChain) == &js_BlockClass);
|
||||
JS_ASSERT(fp->blockChain->getClass() == &js_BlockClass);
|
||||
uintN blockDepth = OBJ_BLOCK_DEPTH(cx, fp->blockChain);
|
||||
|
||||
JS_ASSERT(blockDepth <= StackDepth(script));
|
||||
|
@ -3999,7 +3999,7 @@ BEGIN_CASE(JSOP_LEAVEBLOCK)
|
|||
*/
|
||||
obj = fp->scopeChain;
|
||||
if (obj->getProto() == fp->blockChain) {
|
||||
JS_ASSERT (OBJ_GET_CLASS(cx, obj) == &js_BlockClass);
|
||||
JS_ASSERT(obj->getClass() == &js_BlockClass);
|
||||
if (!js_PutBlockObject(cx, JS_TRUE))
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -5108,7 +5108,7 @@ regexp_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
if (!JSVAL_IS_INT(id))
|
||||
return JS_TRUE;
|
||||
while (OBJ_GET_CLASS(cx, obj) != &js_RegExpClass) {
|
||||
while (obj->getClass() != &js_RegExpClass) {
|
||||
obj = obj->getProto();
|
||||
if (!obj)
|
||||
return JS_TRUE;
|
||||
|
@ -5154,7 +5154,7 @@ regexp_setProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
ok = JS_TRUE;
|
||||
if (!JSVAL_IS_INT(id))
|
||||
return ok;
|
||||
while (OBJ_GET_CLASS(cx, obj) != &js_RegExpClass) {
|
||||
while (obj->getClass() != &js_RegExpClass) {
|
||||
obj = obj->getProto();
|
||||
if (!obj)
|
||||
return JS_TRUE;
|
||||
|
@ -5569,7 +5569,7 @@ regexp_compile_sub(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
* from the original RegExp also).
|
||||
*/
|
||||
obj2 = JSVAL_TO_OBJECT(argv[0]);
|
||||
if (obj2 && OBJ_GET_CLASS(cx, obj2) == &js_RegExpClass) {
|
||||
if (obj2 && obj2->getClass() == &js_RegExpClass) {
|
||||
if (argc >= 2 && !JSVAL_IS_VOID(argv[1])) { /* 'flags' passed */
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
|
||||
JSMSG_NEWREGEXP_FLAGGED);
|
||||
|
@ -5780,7 +5780,7 @@ RegExp(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
*/
|
||||
if ((argc < 2 || JSVAL_IS_VOID(argv[1])) &&
|
||||
!JSVAL_IS_PRIMITIVE(argv[0]) &&
|
||||
OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(argv[0])) == &js_RegExpClass) {
|
||||
JSVAL_TO_OBJECT(argv[0])->getClass() == &js_RegExpClass) {
|
||||
*rval = argv[0];
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -552,7 +552,7 @@ str_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
JSString *str;
|
||||
|
||||
if (id == ATOM_KEY(cx->runtime->atomState.lengthAtom)) {
|
||||
if (OBJ_GET_CLASS(cx, obj) == &js_StringClass) {
|
||||
if (obj->getClass() == &js_StringClass) {
|
||||
/* Follow ECMA-262 by fetching intrinsic length of our string. */
|
||||
v = obj->fslots[JSSLOT_PRIMITIVE_THIS];
|
||||
JS_ASSERT(JSVAL_IS_STRING(v));
|
||||
|
|
|
@ -3120,7 +3120,7 @@ template<typename T>
|
|||
inline uint32
|
||||
GetFromClosure(JSContext* cx, JSObject* call, const ClosureVarInfo* cv, double* result)
|
||||
{
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, call) == &js_CallClass);
|
||||
JS_ASSERT(call->getClass() == &js_CallClass);
|
||||
|
||||
InterpState* state = cx->interpState;
|
||||
|
||||
|
@ -6435,7 +6435,7 @@ ScopeChainCheck(JSContext* cx, TreeFragment* f)
|
|||
}
|
||||
JS_ASSERT(child == f->globalObj);
|
||||
|
||||
if (!(OBJ_GET_CLASS(cx, f->globalObj)->flags & JSCLASS_IS_GLOBAL)) {
|
||||
if (!(f->globalObj->getClass()->flags & JSCLASS_IS_GLOBAL)) {
|
||||
debug_only_print0(LC_TMTracer, "Blacklist: non-global at root of scope chain.\n");
|
||||
Blacklist((jsbytecode*) f->root->ip);
|
||||
return false;
|
||||
|
@ -7879,7 +7879,7 @@ TraceRecorder::scopeChainProp(JSObject* chainHead, jsval*& vp, LIns*& ins, NameR
|
|||
return ARECORD_CONTINUE;
|
||||
}
|
||||
|
||||
if (obj == obj2 && OBJ_GET_CLASS(cx, obj) == &js_CallClass) {
|
||||
if (obj == obj2 && obj->getClass() == &js_CallClass) {
|
||||
AbortableRecordingStatus status =
|
||||
InjectStatus(callProp(obj, prop, ATOM_TO_JSID(atom), vp, ins, nr));
|
||||
obj->dropProperty(cx, prop);
|
||||
|
@ -8670,7 +8670,7 @@ TraceRecorder::equalityHelper(jsval l, jsval r, LIns* l_ins, LIns* r_ins,
|
|||
if (JSVAL_IS_NULL(l))
|
||||
op = LIR_peq;
|
||||
} else if (JSVAL_IS_OBJECT(l)) {
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(l));
|
||||
JSClass *clasp = JSVAL_TO_OBJECT(l)->getClass();
|
||||
if ((clasp->flags & JSCLASS_IS_EXTENDED) && ((JSExtendedClass*) clasp)->equality)
|
||||
RETURN_STOP_A("Can't trace extended class equality operator");
|
||||
op = LIR_peq;
|
||||
|
@ -11097,7 +11097,7 @@ TraceRecorder::incName(jsint incr, bool pre)
|
|||
return ARECORD_CONTINUE;
|
||||
}
|
||||
|
||||
if (OBJ_GET_CLASS(cx, nr.obj) != &js_CallClass)
|
||||
if (nr.obj->getClass() != &js_CallClass)
|
||||
RETURN_STOP_A("incName on unsupported object class");
|
||||
|
||||
CHECK_STATUS_A(setCallProp(nr.obj, nr.obj_ins, nr.sprop, v_after, v));
|
||||
|
@ -11251,7 +11251,7 @@ TraceRecorder::setProp(jsval &l, PropertyCacheEntry* entry, JSScopeProperty* spr
|
|||
|
||||
// Fast path for CallClass. This is about 20% faster than the general case.
|
||||
v_ins = get(&v);
|
||||
if (OBJ_GET_CLASS(cx, obj) == &js_CallClass)
|
||||
if (obj->getClass() == &js_CallClass)
|
||||
return setCallProp(obj, obj_ins, sprop, v_ins, v);
|
||||
|
||||
// Find obj2. If entry->adding(), the TAG bits are all 0.
|
||||
|
@ -12825,11 +12825,11 @@ TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32 *slotp, LIns** v_insp,
|
|||
* We could specialize to guard on just JSClass.getProperty, but a mere
|
||||
* class guard is simpler and slightly faster.
|
||||
*/
|
||||
if (OBJ_GET_CLASS(cx, obj)->getProperty != JS_PropertyStub) {
|
||||
if (obj->getClass()->getProperty != JS_PropertyStub) {
|
||||
RETURN_STOP_A("can't trace through access to undefined property if "
|
||||
"JSClass.getProperty hook isn't stubbed");
|
||||
}
|
||||
guardClass(obj, obj_ins, OBJ_GET_CLASS(cx, obj), snapshot(MISMATCH_EXIT), ACC_OTHER);
|
||||
guardClass(obj, obj_ins, obj->getClass(), snapshot(MISMATCH_EXIT), ACC_OTHER);
|
||||
|
||||
/*
|
||||
* This trace will be valid as long as neither the object nor any object
|
||||
|
@ -13971,7 +13971,7 @@ TraceRecorder::record_JSOP_LAMBDA()
|
|||
jsval lval = stackval(-1);
|
||||
|
||||
if (!JSVAL_IS_PRIMITIVE(lval) &&
|
||||
OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(lval)) == &js_ObjectClass) {
|
||||
JSVAL_TO_OBJECT(lval)->getClass() == &js_ObjectClass) {
|
||||
stack(0, INS_CONSTOBJ(FUN_OBJECT(fun)));
|
||||
return ARECORD_CONTINUE;
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ namespace_equality(JSContext *cx, JSObject *obj, jsval v, JSBool *bp)
|
|||
|
||||
JS_ASSERT(JSVAL_IS_OBJECT(v));
|
||||
obj2 = JSVAL_TO_OBJECT(v);
|
||||
*bp = (!obj2 || OBJ_GET_CLASS(cx, obj2) != &js_NamespaceClass.base)
|
||||
*bp = (!obj2 || obj2->getClass() != &js_NamespaceClass.base)
|
||||
? JS_FALSE
|
||||
: js_EqualStrings(GetURI(obj), GetURI(obj2));
|
||||
return JS_TRUE;
|
||||
|
@ -379,7 +379,7 @@ qname_equality(JSContext *cx, JSObject *qn, jsval v, JSBool *bp)
|
|||
|
||||
JS_ASSERT(JSVAL_IS_OBJECT(v));
|
||||
obj2 = JSVAL_TO_OBJECT(v);
|
||||
*bp = (!obj2 || OBJ_GET_CLASS(cx, obj2) != &js_QNameClass.base)
|
||||
*bp = (!obj2 || obj2->getClass() != &js_QNameClass.base)
|
||||
? JS_FALSE
|
||||
: qname_identity(qn, obj2);
|
||||
return JS_TRUE;
|
||||
|
@ -447,7 +447,7 @@ qname_toString(JSContext *cx, uintN argc, jsval *vp)
|
|||
obj = JS_THIS_OBJECT(cx, vp);
|
||||
if (!obj)
|
||||
return JS_FALSE;
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp != &js_AttributeNameClass &&
|
||||
clasp != &js_AnyNameClass &&
|
||||
!JS_InstanceOf(cx, obj, &js_QNameClass.base, vp + 2)) {
|
||||
|
@ -537,7 +537,7 @@ js_ConstructXMLQNameObject(JSContext *cx, jsval nsval, jsval lnval)
|
|||
* production, step 2.
|
||||
*/
|
||||
if (!JSVAL_IS_PRIMITIVE(nsval) &&
|
||||
OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(nsval)) == &js_AnyNameClass) {
|
||||
JSVAL_TO_OBJECT(nsval)->getClass() == &js_AnyNameClass) {
|
||||
nsval = JSVAL_NULL;
|
||||
}
|
||||
|
||||
|
@ -577,7 +577,7 @@ js_IsXMLName(JSContext *cx, jsval v)
|
|||
* See ECMA-357 13.1.2.1 step 1 and 13.3.2.
|
||||
*/
|
||||
if (!JSVAL_IS_PRIMITIVE(v) &&
|
||||
IsQNameClass(OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(v)))) {
|
||||
IsQNameClass(JSVAL_TO_OBJECT(v)->getClass())) {
|
||||
name = GetLocalName(JSVAL_TO_OBJECT(v));
|
||||
} else {
|
||||
older = JS_SetErrorReporter(cx, NULL);
|
||||
|
@ -616,7 +616,7 @@ NamespaceHelper(JSContext *cx, JSObject *obj, intN argc, jsval *argv,
|
|||
urival = argv[argc > 1];
|
||||
if (!JSVAL_IS_PRIMITIVE(urival)) {
|
||||
uriobj = JSVAL_TO_OBJECT(urival);
|
||||
clasp = OBJ_GET_CLASS(cx, uriobj);
|
||||
clasp = uriobj->getClass();
|
||||
isNamespace = (clasp == &js_NamespaceClass.base);
|
||||
isQName = (clasp == &js_QNameClass.base);
|
||||
}
|
||||
|
@ -722,7 +722,7 @@ QNameHelper(JSContext *cx, JSObject *obj, JSClass *clasp, intN argc,
|
|||
nameval = argv[argc > 1];
|
||||
isQName =
|
||||
!JSVAL_IS_PRIMITIVE(nameval) &&
|
||||
OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(nameval)) == &js_QNameClass.base;
|
||||
JSVAL_TO_OBJECT(nameval)->getClass() == &js_QNameClass.base;
|
||||
}
|
||||
|
||||
if (!obj) {
|
||||
|
@ -777,7 +777,7 @@ QNameHelper(JSContext *cx, JSObject *obj, JSClass *clasp, intN argc,
|
|||
if (!js_GetDefaultXMLNamespace(cx, &nsval))
|
||||
return JS_FALSE;
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(nsval));
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(nsval)) ==
|
||||
JS_ASSERT(JSVAL_TO_OBJECT(nsval)->getClass() ==
|
||||
&js_NamespaceClass.base);
|
||||
}
|
||||
|
||||
|
@ -795,7 +795,7 @@ QNameHelper(JSContext *cx, JSObject *obj, JSClass *clasp, intN argc,
|
|||
isNamespace = isQName = JS_FALSE;
|
||||
if (!JSVAL_IS_PRIMITIVE(nsval)) {
|
||||
obj2 = JSVAL_TO_OBJECT(nsval);
|
||||
clasp = OBJ_GET_CLASS(cx, obj2);
|
||||
clasp = obj2->getClass();
|
||||
isNamespace = (clasp == &js_NamespaceClass.base);
|
||||
isQName = (clasp == &js_QNameClass.base);
|
||||
}
|
||||
|
@ -1926,7 +1926,7 @@ ToXML(JSContext *cx, jsval v)
|
|||
return obj;
|
||||
}
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp->flags & JSCLASS_DOCUMENT_OBSERVER) {
|
||||
JS_ASSERT(0);
|
||||
}
|
||||
|
@ -2007,7 +2007,7 @@ ToXMLList(JSContext *cx, jsval v)
|
|||
return obj;
|
||||
}
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp->flags & JSCLASS_DOCUMENT_OBSERVER) {
|
||||
JS_ASSERT(0);
|
||||
}
|
||||
|
@ -2854,7 +2854,7 @@ ToAttributeName(JSContext *cx, jsval v)
|
|||
}
|
||||
|
||||
obj = JSVAL_TO_OBJECT(v);
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp == &js_AttributeNameClass)
|
||||
return obj;
|
||||
|
||||
|
@ -2907,7 +2907,7 @@ IsFunctionQName(JSContext *cx, JSObject *qn, jsid *funidp)
|
|||
JSBool
|
||||
js_IsFunctionQName(JSContext *cx, JSObject *obj, jsid *funidp)
|
||||
{
|
||||
if (OBJ_GET_CLASS(cx, obj) == &js_QNameClass.base)
|
||||
if (obj->getClass() == &js_QNameClass.base)
|
||||
return IsFunctionQName(cx, obj, funidp);
|
||||
*funidp = 0;
|
||||
return JS_TRUE;
|
||||
|
@ -2930,7 +2930,7 @@ ToXMLName(JSContext *cx, jsval v, jsid *funidp)
|
|||
}
|
||||
|
||||
obj = JSVAL_TO_OBJECT(v);
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = obj->getClass();
|
||||
if (clasp == &js_AttributeNameClass || clasp == &js_QNameClass.base)
|
||||
goto out;
|
||||
if (clasp == &js_AnyNameClass) {
|
||||
|
@ -3286,7 +3286,7 @@ DescendantsHelper(JSContext *cx, JSXML *xml, JSObject *nameqn, JSXML *list)
|
|||
JS_CHECK_RECURSION(cx, return JS_FALSE);
|
||||
|
||||
if (xml->xml_class == JSXML_CLASS_ELEMENT &&
|
||||
OBJ_GET_CLASS(cx, nameqn) == &js_AttributeNameClass) {
|
||||
nameqn->getClass() == &js_AttributeNameClass) {
|
||||
for (i = 0, n = xml->xml_attrs.length; i < n; i++) {
|
||||
attr = XMLARRAY_MEMBER(&xml->xml_attrs, i, JSXML);
|
||||
if (attr && MatchAttrName(nameqn, attr)) {
|
||||
|
@ -3300,7 +3300,7 @@ DescendantsHelper(JSContext *cx, JSXML *xml, JSObject *nameqn, JSXML *list)
|
|||
kid = XMLARRAY_MEMBER(&xml->xml_kids, i, JSXML);
|
||||
if (!kid)
|
||||
continue;
|
||||
if (OBJ_GET_CLASS(cx, nameqn) != &js_AttributeNameClass &&
|
||||
if (nameqn->getClass() != &js_AttributeNameClass &&
|
||||
MatchElemName(nameqn, kid)) {
|
||||
if (!Append(cx, list, kid))
|
||||
return JS_FALSE;
|
||||
|
@ -3763,7 +3763,7 @@ GetNamedProperty(JSContext *cx, JSXML *xml, JSObject* nameqn, JSXML *list)
|
|||
}
|
||||
}
|
||||
} else if (xml->xml_class == JSXML_CLASS_ELEMENT) {
|
||||
attrs = (OBJ_GET_CLASS(cx, nameqn) == &js_AttributeNameClass);
|
||||
attrs = (nameqn->getClass() == &js_AttributeNameClass);
|
||||
if (attrs) {
|
||||
array = &xml->xml_attrs;
|
||||
matcher = MatchAttrName;
|
||||
|
@ -4011,7 +4011,7 @@ PutProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
goto bad;
|
||||
} else {
|
||||
nameobj = targetprop;
|
||||
if (OBJ_GET_CLASS(cx, nameobj) == &js_AttributeNameClass) {
|
||||
if (nameobj->getClass() == &js_AttributeNameClass) {
|
||||
/*
|
||||
* 2(c)(iii)(1-3).
|
||||
* Note that rxml can't be null here, because target
|
||||
|
@ -4107,7 +4107,7 @@ PutProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
parent = kid->parent;
|
||||
if (kid->xml_class == JSXML_CLASS_ATTRIBUTE) {
|
||||
nameobj = kid->name;
|
||||
if (OBJ_GET_CLASS(cx, nameobj) != &js_AttributeNameClass) {
|
||||
if (nameobj->getClass() != &js_AttributeNameClass) {
|
||||
nameobj = NewXMLQName(cx, GetURI(nameobj), GetPrefix(nameobj),
|
||||
GetLocalName(nameobj),
|
||||
&js_AttributeNameClass);
|
||||
|
@ -4315,7 +4315,7 @@ PutProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
if (!ok)
|
||||
goto out;
|
||||
|
||||
if (OBJ_GET_CLASS(cx, nameobj) == &js_AttributeNameClass) {
|
||||
if (nameobj->getClass() == &js_AttributeNameClass) {
|
||||
/* 7(a). */
|
||||
if (!js_IsXMLName(cx, OBJECT_TO_JSVAL(nameobj)))
|
||||
goto out;
|
||||
|
@ -4566,7 +4566,7 @@ ResolveValue(JSContext *cx, JSXML *list, JSXML **result)
|
|||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if (OBJ_GET_CLASS(cx, targetprop) == &js_AttributeNameClass) {
|
||||
if (targetprop->getClass() == &js_AttributeNameClass) {
|
||||
*result = NULL;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -4622,7 +4622,7 @@ HasNamedProperty(JSXML *xml, JSObject *nameqn)
|
|||
}
|
||||
|
||||
if (xml->xml_class == JSXML_CLASS_ELEMENT) {
|
||||
if (OBJ_GET_CLASS(cx, nameqn) == &js_AttributeNameClass) {
|
||||
if (nameqn->getClass() == &js_AttributeNameClass) {
|
||||
array = &xml->xml_attrs;
|
||||
matcher = MatchAttrName;
|
||||
} else {
|
||||
|
@ -4661,7 +4661,7 @@ HasFunctionProperty(JSContext *cx, JSObject *obj, jsid funid, JSBool *found)
|
|||
JSProperty *prop;
|
||||
JSXML *xml;
|
||||
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_XMLClass);
|
||||
JS_ASSERT(obj->getClass() == &js_XMLClass);
|
||||
|
||||
if (!js_LookupProperty(cx, obj, funid, &pobj, &prop))
|
||||
return false;
|
||||
|
@ -4902,8 +4902,7 @@ xml_deleteProperty(JSContext *cx, JSObject *obj, jsid id, jsval *rval)
|
|||
return js_DeleteProperty(cx, obj, funid, rval);
|
||||
|
||||
DeleteNamedProperty(cx, xml, nameqn,
|
||||
OBJ_GET_CLASS(cx, nameqn) ==
|
||||
&js_AttributeNameClass);
|
||||
nameqn->getClass() == &js_AttributeNameClass);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -6521,7 +6520,7 @@ xml_setLocalName(JSContext *cx, uintN argc, jsval *vp)
|
|||
} else {
|
||||
name = vp[2];
|
||||
if (!JSVAL_IS_PRIMITIVE(name) &&
|
||||
OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(name)) == &js_QNameClass.base) {
|
||||
JSVAL_TO_OBJECT(name)->getClass() == &js_QNameClass.base) {
|
||||
nameqn = JSVAL_TO_OBJECT(name);
|
||||
namestr = GetLocalName(nameqn);
|
||||
} else {
|
||||
|
@ -6561,7 +6560,7 @@ xml_setName(JSContext *cx, uintN argc, jsval *vp)
|
|||
} else {
|
||||
name = vp[2];
|
||||
if (!JSVAL_IS_PRIMITIVE(name) &&
|
||||
OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(name)) == &js_QNameClass.base &&
|
||||
JSVAL_TO_OBJECT(name)->getClass() == &js_QNameClass.base &&
|
||||
!GetURI(nameqn = JSVAL_TO_OBJECT(name))) {
|
||||
name = vp[2] = nameqn->fslots[JSSLOT_LOCAL_NAME];
|
||||
}
|
||||
|
@ -7004,7 +7003,7 @@ XML(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
|
||||
if (cx->isConstructing() && !JSVAL_IS_PRIMITIVE(v)) {
|
||||
vobj = JSVAL_TO_OBJECT(v);
|
||||
clasp = OBJ_GET_CLASS(cx, vobj);
|
||||
clasp = vobj->getClass();
|
||||
if (clasp == &js_XMLClass ||
|
||||
(clasp->flags & JSCLASS_DOCUMENT_OBSERVER)) {
|
||||
/* No need to lock obj, it's newly constructed and thread local. */
|
||||
|
@ -7406,7 +7405,7 @@ js_GetDefaultXMLNamespace(JSContext *cx, jsval *vp)
|
|||
|
||||
obj = NULL;
|
||||
for (tmp = fp->scopeChain; tmp; tmp = tmp->getParent()) {
|
||||
JSClass *clasp = OBJ_GET_CLASS(cx, tmp);
|
||||
JSClass *clasp = tmp->getClass();
|
||||
if (clasp == &js_BlockClass || clasp == &js_WithClass)
|
||||
continue;
|
||||
if (!tmp->getProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, &v))
|
||||
|
@ -7619,15 +7618,15 @@ js_FindXMLProperty(JSContext *cx, jsval nameval, JSObject **objp, jsid *idp)
|
|||
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(nameval));
|
||||
nameobj = JSVAL_TO_OBJECT(nameval);
|
||||
if (OBJ_GET_CLASS(cx, nameobj) == &js_AnyNameClass) {
|
||||
if (nameobj->getClass() == &js_AnyNameClass) {
|
||||
v = STRING_TO_JSVAL(ATOM_TO_STRING(cx->runtime->atomState.starAtom));
|
||||
nameobj = js_ConstructObject(cx, &js_QNameClass.base, NULL, NULL, 1,
|
||||
&v);
|
||||
if (!nameobj)
|
||||
return JS_FALSE;
|
||||
} else {
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, nameobj) == &js_AttributeNameClass ||
|
||||
OBJ_GET_CLASS(cx, nameobj) == &js_QNameClass.base);
|
||||
JS_ASSERT(nameobj->getClass() == &js_AttributeNameClass ||
|
||||
nameobj->getClass() == &js_QNameClass.base);
|
||||
}
|
||||
|
||||
qn = nameobj;
|
||||
|
@ -7638,7 +7637,7 @@ js_FindXMLProperty(JSContext *cx, jsval nameval, JSObject **objp, jsid *idp)
|
|||
do {
|
||||
/* Skip any With object that can wrap XML. */
|
||||
target = obj;
|
||||
while (OBJ_GET_CLASS(cx, target) == &js_WithClass) {
|
||||
while (target->getClass() == &js_WithClass) {
|
||||
proto = target->getProto();
|
||||
if (!proto)
|
||||
break;
|
||||
|
@ -7722,7 +7721,7 @@ GetPrivate(JSContext *cx, JSObject *obj, const char *method)
|
|||
if (!xml) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
|
||||
JSMSG_INCOMPATIBLE_METHOD,
|
||||
js_XML_str, method, OBJ_GET_CLASS(cx, obj)->name);
|
||||
js_XML_str, method, obj->getClass()->name);
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
|
@ -7872,8 +7871,7 @@ js_StepXMLListFilter(JSContext *cx, JSBool initialized)
|
|||
} else {
|
||||
/* We have iterated at least once. */
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(sp[-2]));
|
||||
JS_ASSERT(OBJ_GET_CLASS(cx, JSVAL_TO_OBJECT(sp[-2])) ==
|
||||
&js_XMLFilterClass);
|
||||
JS_ASSERT(JSVAL_TO_OBJECT(sp[-2])->getClass() == &js_XMLFilterClass);
|
||||
filter = (JSXMLFilter *) JSVAL_TO_OBJECT(sp[-2])->getPrivate();
|
||||
JS_ASSERT(filter->kid);
|
||||
|
||||
|
|
|
@ -727,7 +727,7 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb)
|
|||
if(traceKind == JSTRACE_OBJECT)
|
||||
{
|
||||
obj = static_cast<JSObject*>(p);
|
||||
clazz = OBJ_GET_CLASS(cx, obj);
|
||||
clazz = obj->getClass();
|
||||
|
||||
if(clazz == &XPC_WN_Tearoff_JSClass)
|
||||
{
|
||||
|
@ -777,7 +777,7 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb)
|
|||
if(traceKind == JSTRACE_OBJECT)
|
||||
{
|
||||
JSObject *obj = static_cast<JSObject*>(p);
|
||||
JSClass *clazz = OBJ_GET_CLASS(cx, obj);
|
||||
JSClass *clazz = obj->getClass();
|
||||
if(XPCNativeWrapper::IsNativeWrapperClass(clazz))
|
||||
{
|
||||
XPCWrappedNative* wn;
|
||||
|
|
Загрузка…
Ссылка в новой задаче