зеркало из https://github.com/mozilla/pjs.git
Backing out bug 326497 again to see if it fixes the problems that we're seeing with us not recognizing functions set on [classname].prototype.
This commit is contained in:
Родитель
997920c932
Коммит
100614cf8e
|
@ -3321,6 +3321,13 @@ nsDOMClassInfo::PostCreate(nsIXPConnectWrappedNative *wrapper,
|
|||
}
|
||||
#endif
|
||||
|
||||
JSObject *global = GetGlobalJSObject(cx, obj);
|
||||
|
||||
jsval val;
|
||||
if (!::JS_GetProperty(cx, global, mData->mName, &val)) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -4623,18 +4630,14 @@ public:
|
|||
|
||||
nsresult Install(JSContext *cx, JSObject *target, jsval thisAsVal)
|
||||
{
|
||||
PRBool doSecurityCheckInAddProperty =
|
||||
nsDOMClassInfo::sDoSecurityCheckInAddProperty;
|
||||
nsDOMClassInfo::sDoSecurityCheckInAddProperty = PR_FALSE;
|
||||
|
||||
JSBool ok = ::JS_DefineUCProperty(cx, target,
|
||||
NS_REINTERPRET_CAST(const jschar *, mClassName),
|
||||
nsCRT::strlen(mClassName), thisAsVal, nsnull,
|
||||
nsnull, 0);
|
||||
|
||||
nsDOMClassInfo::sDoSecurityCheckInAddProperty =
|
||||
doSecurityCheckInAddProperty;
|
||||
return ok ? NS_OK : NS_ERROR_UNEXPECTED;
|
||||
if (!::JS_DefineUCProperty(cx, target,
|
||||
NS_REINTERPRET_CAST(const jschar *, mClassName),
|
||||
nsCRT::strlen(mClassName), thisAsVal, nsnull,
|
||||
nsnull, 0)) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -365,7 +365,6 @@ protected:
|
|||
static const JSClass *sObjectClass;
|
||||
static const JSClass *sXPCNativeWrapperClass;
|
||||
|
||||
public:
|
||||
static PRBool sDoSecurityCheckInAddProperty;
|
||||
};
|
||||
|
||||
|
|
|
@ -2515,7 +2515,6 @@ private:
|
|||
|
||||
static void BuildAndThrowException(JSContext* cx, nsresult rv, const char* sz);
|
||||
static JSBool ThrowExceptionObject(JSContext* cx, nsIException* e);
|
||||
static JSBool CheckForPendingException(nsresult result, XPCCallContext &ccx);
|
||||
|
||||
private:
|
||||
static JSBool sVerbose;
|
||||
|
|
|
@ -461,10 +461,8 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx,
|
|||
XPCNativeScriptableInfo* si = wrapper->GetScriptableInfo();
|
||||
if(si && si->GetFlags().WantPostCreate())
|
||||
{
|
||||
rv = si->GetCallback()->
|
||||
PostCreate(wrapper, ccx, wrapper->GetFlatJSObject());
|
||||
if(NS_FAILED(rv))
|
||||
return rv;
|
||||
si->GetCallback()->
|
||||
PostCreate(wrapper, ccx, wrapper->GetFlatJSObject());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче