зеркало из https://github.com/mozilla/gecko-dev.git
Bug 417710 - "Use JS_GET_CLASS, not JS_GetClass" [p=gyuyoung.kim@samsung.com (gyu-young kim) r=jorendorff r=jst sr+a1.9=brendan]
This commit is contained in:
Родитель
88e6a0f904
Коммит
5d4ef49dd4
|
@ -301,7 +301,7 @@ nsSecurityNameSet::InitializeNameSet(nsIScriptContext* aScriptContext)
|
||||||
JSAutoRequest ar(cx);
|
JSAutoRequest ar(cx);
|
||||||
while ((proto = JS_GetPrototype(cx, obj)) != nsnull)
|
while ((proto = JS_GetPrototype(cx, obj)) != nsnull)
|
||||||
obj = proto;
|
obj = proto;
|
||||||
JSClass *objectClass = JS_GetClass(cx, obj);
|
JSClass *objectClass = JS_GET_CLASS(cx, obj);
|
||||||
|
|
||||||
jsval v;
|
jsval v;
|
||||||
if (!JS_GetProperty(cx, global, "netscape", &v))
|
if (!JS_GetProperty(cx, global, "netscape", &v))
|
||||||
|
|
|
@ -120,7 +120,7 @@ XBLFinalize(JSContext *cx, JSObject *obj)
|
||||||
static_cast<nsIXBLDocumentInfo*>(::JS_GetPrivate(cx, obj));
|
static_cast<nsIXBLDocumentInfo*>(::JS_GetPrivate(cx, obj));
|
||||||
NS_RELEASE(docInfo);
|
NS_RELEASE(docInfo);
|
||||||
|
|
||||||
nsXBLJSClass* c = static_cast<nsXBLJSClass*>(::JS_GetClass(cx, obj));
|
nsXBLJSClass* c = static_cast<nsXBLJSClass*>(::JS_GET_CLASS(cx, obj));
|
||||||
c->Drop();
|
c->Drop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ XBLResolve(JSContext *cx, JSObject *obj, jsval id, uintN flags,
|
||||||
}
|
}
|
||||||
|
|
||||||
// We have this field. Time to install it. Get our node.
|
// We have this field. Time to install it. Get our node.
|
||||||
JSClass* nodeClass = ::JS_GetClass(cx, origObj);
|
JSClass* nodeClass = ::JS_GET_CLASS(cx, origObj);
|
||||||
if (!nodeClass) {
|
if (!nodeClass) {
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1085,7 +1085,7 @@ nsXBLBinding::ChangeDocument(nsIDocument* aOldDocument, nsIDocument* aNewDocumen
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSClass* clazz = ::JS_GetClass(cx, proto);
|
JSClass* clazz = ::JS_GET_CLASS(cx, proto);
|
||||||
if (!clazz ||
|
if (!clazz ||
|
||||||
(~clazz->flags &
|
(~clazz->flags &
|
||||||
(JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS)) ||
|
(JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS)) ||
|
||||||
|
|
|
@ -169,7 +169,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return sXPCNativeWrapperClass &&
|
return sXPCNativeWrapperClass &&
|
||||||
::JS_GetClass(cx, obj) == sXPCNativeWrapperClass;
|
::JS_GET_CLASS(cx, obj) == sXPCNativeWrapperClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult PreserveNodeWrapper(nsIXPConnectWrappedNative *aWrapper);
|
static nsresult PreserveNodeWrapper(nsIXPConnectWrappedNative *aWrapper);
|
||||||
|
|
|
@ -2824,7 +2824,7 @@ nsJSContext::FindXPCNativeWrapperClass(nsIXPConnectJSObjectHolder *aHolder)
|
||||||
NS_ASSERTION(JSVAL_IS_OBJECT(wrapper), "This should be an object!");
|
NS_ASSERTION(JSVAL_IS_OBJECT(wrapper), "This should be an object!");
|
||||||
|
|
||||||
NS_DOMClassInfo_SetXPCNativeWrapperClass(
|
NS_DOMClassInfo_SetXPCNativeWrapperClass(
|
||||||
::JS_GetClass(mContext, JSVAL_TO_OBJECT(wrapper)));
|
::JS_GET_CLASS(mContext, JSVAL_TO_OBJECT(wrapper)));
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,11 +60,7 @@ nsWWJSUtils::GetStaticScriptGlobal(JSContext* aContext, JSObject* aObj)
|
||||||
while (nsnull != (parent = JS_GetParent(aContext, glob)))
|
while (nsnull != (parent = JS_GetParent(aContext, glob)))
|
||||||
glob = parent;
|
glob = parent;
|
||||||
|
|
||||||
#ifdef JS_THREADSAFE
|
clazz = JS_GET_CLASS(aContext, glob);
|
||||||
clazz = JS_GetClass(aContext, glob);
|
|
||||||
#else
|
|
||||||
clazz = JS_GetClass(glob);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!clazz ||
|
if (!clazz ||
|
||||||
!(clazz->flags & JSCLASS_HAS_PRIVATE) ||
|
!(clazz->flags & JSCLASS_HAS_PRIVATE) ||
|
||||||
|
|
|
@ -512,11 +512,7 @@ JavaClass_hasInstance(JSContext *cx, JSObject *obj, jsval candidate_jsval,
|
||||||
if (!JSVAL_IS_OBJECT(candidate_jsval))
|
if (!JSVAL_IS_OBJECT(candidate_jsval))
|
||||||
goto done;
|
goto done;
|
||||||
candidate_obj = JSVAL_TO_OBJECT(candidate_jsval);
|
candidate_obj = JSVAL_TO_OBJECT(candidate_jsval);
|
||||||
#ifdef JS_THREADSAFE
|
js_class = JS_GET_CLASS(cx, candidate_obj);
|
||||||
js_class = JS_GetClass(cx, candidate_obj);
|
|
||||||
#else
|
|
||||||
js_class = JS_GetClass(candidate_obj);
|
|
||||||
#endif
|
|
||||||
if ((js_class != &JavaObject_class) && (js_class != &JavaArray_class))
|
if ((js_class != &JavaObject_class) && (js_class != &JavaArray_class))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
|
|
@ -211,11 +211,7 @@ void nsXPITriggerInfo::SaveCallback( JSContext *aCx, jsval aVal )
|
||||||
|
|
||||||
JSClass* clazz;
|
JSClass* clazz;
|
||||||
|
|
||||||
#ifdef JS_THREADSAFE
|
clazz = ::JS_GET_CLASS(aCx, obj);
|
||||||
clazz = ::JS_GetClass(aCx, obj);
|
|
||||||
#else
|
|
||||||
clazz = ::JS_GetClass(obj);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (clazz &&
|
if (clazz &&
|
||||||
(clazz->flags & JSCLASS_HAS_PRIVATE) &&
|
(clazz->flags & JSCLASS_HAS_PRIVATE) &&
|
||||||
|
|
Загрузка…
Ссылка в новой задаче