mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fixing bug 424019. Fix problem with NPN_RemoveProperty() claiming it removed a property when it in fact didn't. r+sr=brendan@mozilla.org
This commit is contained in:
parent
7598733582
commit
f5ff3db7a8
@ -858,10 +858,41 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier identifier)
|
||||
|
||||
ok = ::JS_DeleteUCProperty2(cx, npjsobj->mJSObj, ::JS_GetStringChars(str),
|
||||
::JS_GetStringLength(str), &deleted);
|
||||
|
||||
if (ok && deleted) {
|
||||
// FIXME: See bug 425823, we shouldn't need to do this, and once
|
||||
// that bug is fixed we can remove this code.
|
||||
|
||||
JSBool hasProp;
|
||||
ok = ::JS_HasUCProperty(cx, npjsobj->mJSObj, ::JS_GetStringChars(str),
|
||||
::JS_GetStringLength(str), &hasProp);
|
||||
|
||||
if (ok && hasProp) {
|
||||
// The property might have been deleted, but it got
|
||||
// re-resolved, so no, it's not really deleted.
|
||||
|
||||
deleted = JSVAL_FALSE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NS_ASSERTION(JSVAL_IS_INT(id), "id must be either string or int!\n");
|
||||
|
||||
ok = ::JS_DeleteElement2(cx, npjsobj->mJSObj, JSVAL_TO_INT(id), &deleted);
|
||||
|
||||
if (ok && deleted) {
|
||||
// FIXME: See bug 425823, we shouldn't need to do this, and once
|
||||
// that bug is fixed we can remove this code.
|
||||
|
||||
JSBool hasProp;
|
||||
ok = ::JS_HasElement(cx, npjsobj->mJSObj, JSVAL_TO_INT(id), &hasProp);
|
||||
|
||||
if (ok && hasProp) {
|
||||
// The property might have been deleted, but it got
|
||||
// re-resolved, so no, it's not really deleted.
|
||||
|
||||
deleted = JSVAL_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return ok == JS_TRUE to quiet down compiler warning, even if
|
||||
|
Loading…
Reference in New Issue
Block a user