From de63e533a425eb02f0b5d825efac63a7a4a79b11 Mon Sep 17 00:00:00 2001 From: "jst%mozilla.org" Date: Thu, 10 Jan 2008 21:44:06 +0000 Subject: [PATCH] Fixing bug 411040. Make NPN_RemoveProperty() return false if the property wasn't deleted (due to silent failure per ecma). r+sr+a=brendan@mozilla.org git-svn-id: svn://10.0.0.236/trunk@242855 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/plugin/base/src/nsJSNPRuntime.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/modules/plugin/base/src/nsJSNPRuntime.cpp b/mozilla/modules/plugin/base/src/nsJSNPRuntime.cpp index 7f2280d07c6..e348e22da4a 100644 --- a/mozilla/modules/plugin/base/src/nsJSNPRuntime.cpp +++ b/mozilla/modules/plugin/base/src/nsJSNPRuntime.cpp @@ -835,22 +835,22 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier identifier) AutoCXPusher pusher(cx); JSAutoRequest ar(cx); AutoJSExceptionReporter reporter(cx); + jsval deleted = JSVAL_FALSE; if (JSVAL_IS_STRING(id)) { JSString *str = JSVAL_TO_STRING(id); - jsval unused; ok = ::JS_DeleteUCProperty2(cx, npjsobj->mJSObj, ::JS_GetStringChars(str), - ::JS_GetStringLength(str), &unused); + ::JS_GetStringLength(str), &deleted); } else { NS_ASSERTION(JSVAL_IS_INT(id), "id must be either string or int!\n"); - ok = ::JS_DeleteElement(cx, npjsobj->mJSObj, JSVAL_TO_INT(id)); + ok = ::JS_DeleteElement2(cx, npjsobj->mJSObj, JSVAL_TO_INT(id), &deleted); } // return ok == JS_TRUE to quiet down compiler warning, even if // return ok is what we really want. - return ok == JS_TRUE; + return ok == JS_TRUE && deleted == JSVAL_TRUE; } //static