зеркало из https://github.com/mozilla/pjs.git
Try fixing bug 326497 again, this time allowing DOM constructors to be wrapped in cross-domain settings, since some of them can be used (e.g., Location). r+sr=jst for the DOM bits, r=brendan sr=shaver for the XPConnect bits.
This commit is contained in:
Родитель
81a1a0f020
Коммит
aa30098ef8
|
@ -3302,13 +3302,6 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -4611,14 +4604,18 @@ public:
|
|||
|
||||
nsresult Install(JSContext *cx, JSObject *target, jsval thisAsVal)
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -6424,7 +6421,7 @@ nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
|
|||
|
||||
// Get the script global object from the document.
|
||||
|
||||
native_parent = doc->GetScriptGlobalObject();
|
||||
native_parent = doc->GetScopeObject();
|
||||
|
||||
if (!native_parent) {
|
||||
// No global object reachable from this document, use the
|
||||
|
|
|
@ -365,6 +365,7 @@ protected:
|
|||
static const JSClass *sObjectClass;
|
||||
static const JSClass *sXPCNativeWrapperClass;
|
||||
|
||||
public:
|
||||
static PRBool sDoSecurityCheckInAddProperty;
|
||||
};
|
||||
|
||||
|
|
|
@ -2515,6 +2515,7 @@ 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,8 +461,10 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx,
|
|||
XPCNativeScriptableInfo* si = wrapper->GetScriptableInfo();
|
||||
if(si && si->GetFlags().WantPostCreate())
|
||||
{
|
||||
si->GetCallback()->
|
||||
PostCreate(wrapper, ccx, wrapper->GetFlatJSObject());
|
||||
rv = si->GetCallback()->
|
||||
PostCreate(wrapper, ccx, wrapper->GetFlatJSObject());
|
||||
if(NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче