This commit is contained in:
jst%mozilla.jstenback.com 2005-06-09 01:11:21 +00:00
Родитель 34cb2bd76d
Коммит 48772b9d27
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -445,11 +445,8 @@ nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JSObject *obj,
// a different trust domain. // a different trust domain.
// 2. A user-defined getter or setter function accessible on another // 2. A user-defined getter or setter function accessible on another
// trust domain's window or document object. // trust domain's window or document object.
// If *vp is not a primitive, some new JS engine call to this hook was // *vp can be a primitive, in that case, we use obj as the target
// added, but we can handle that case too -- if a primitive value in a
// property of obj is being accessed, we should use obj as the target
// object. // object.
NS_ASSERTION(!JSVAL_IS_PRIMITIVE(*vp), "unexpected target property value");
JSObject* target = JSVAL_IS_PRIMITIVE(*vp) ? obj : JSVAL_TO_OBJECT(*vp); JSObject* target = JSVAL_IS_PRIMITIVE(*vp) ? obj : JSVAL_TO_OBJECT(*vp);
// Do the same-origin check -- this sets a JS exception if the check fails. // Do the same-origin check -- this sets a JS exception if the check fails.