JS delete operator should invoke npruntime removeProperty on NPObject. b=470291 r/sr=jst

This commit is contained in:
Josh Aas 2009-01-16 12:14:43 -05:00
Родитель 66c5c3d3df
Коммит 0221450ec2
1 изменённых файлов: 6 добавлений и 6 удалений

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

@ -1166,18 +1166,18 @@ NPObjWrapper_DelProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
NPObject *npobj = GetNPObject(cx, obj);
if (!npobj || !npobj->_class || !npobj->_class->hasProperty) {
if (!npobj || !npobj->_class || !npobj->_class->hasProperty ||
!npobj->_class->removeProperty) {
ThrowJSException(cx, "Bad NPObject as private data!");
return JS_FALSE;
}
if (!npobj->_class->hasProperty(npobj, (NPIdentifier)id)) {
ThrowJSException(cx, "Trying to remove unsupported property on scriptable "
"plugin object!");
if (!npobj->_class->hasProperty(npobj, (NPIdentifier)id))
return JS_TRUE;
return JS_FALSE;
}
if (!npobj->_class->removeProperty(npobj, (NPIdentifier)id))
*vp = JSVAL_FALSE;
return ReportExceptionIfPending(cx);
}