зеркало из https://github.com/mozilla/gecko-dev.git
bug 474358 - ASSERTION: Inner window detected in Equality hook, isOuterWindow, p=me, r=timeless, sr=mrbkap
This commit is contained in:
Родитель
f5f42d9fb3
Коммит
ffb3a9b881
|
@ -40,6 +40,19 @@
|
|||
*/
|
||||
|
||||
#include "jsd.h"
|
||||
#include "jsapi.h"
|
||||
|
||||
/*
|
||||
* Lifted with slight modification from jsobj.h
|
||||
*/
|
||||
|
||||
#define OBJ_TO_OUTER_OBJECT(cx, obj) \
|
||||
JSClass *clasp_ = JS_GetClass(cx, obj); \
|
||||
if (clasp_->flags & JSCLASS_IS_EXTENDED) { \
|
||||
JSExtendedClass *xclasp_ = (JSExtendedClass*) clasp_; \
|
||||
if (xclasp_->outerObject) \
|
||||
obj = xclasp_->outerObject(cx, obj); \
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void JSD_ASSERT_VALID_VALUE(JSDValue* jsdval)
|
||||
|
@ -294,7 +307,23 @@ jsd_DropValue(JSDContext* jsdc, JSDValue* jsdval)
|
|||
jsval
|
||||
jsd_GetValueWrappedJSVal(JSDContext* jsdc, JSDValue* jsdval)
|
||||
{
|
||||
return jsdval->val;
|
||||
JSObject* obj;
|
||||
JSContext* cx;
|
||||
jsval val = jsdval->val;
|
||||
if (!JSVAL_IS_PRIMITIVE(val)) {
|
||||
cx = JSD_GetDefaultJSContext(jsdc);
|
||||
obj = JSVAL_TO_OBJECT(val);
|
||||
OBJ_TO_OUTER_OBJECT(cx, obj);
|
||||
if (!obj)
|
||||
{
|
||||
JS_ClearPendingException(cx);
|
||||
val = JSVAL_NULL;
|
||||
}
|
||||
else
|
||||
val = OBJECT_TO_JSVAL(obj);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static JSDProperty* _newProperty(JSDContext* jsdc, JSPropertyDesc* pd,
|
||||
|
|
|
@ -141,6 +141,11 @@ struct JSObjectMap {
|
|||
} \
|
||||
JS_END_MACRO
|
||||
|
||||
/*
|
||||
* The following macro has been copied to jsd/jsd_val.c. If making changes to
|
||||
* OBJ_TO_OUTER_OBJECT, please update jsd/jsd_val.c as well.
|
||||
*/
|
||||
|
||||
#define OBJ_TO_OUTER_OBJECT(cx,obj) \
|
||||
JS_BEGIN_MACRO \
|
||||
JSClass *clasp_ = OBJ_GET_CLASS(cx, obj); \
|
||||
|
|
Загрузка…
Ссылка в новой задаче