зеркало из https://github.com/mozilla/gecko-dev.git
JS delete operator should invoke npruntime removeProperty on NPObject. b=470291 r/sr=jst
This commit is contained in:
Родитель
66c5c3d3df
Коммит
0221450ec2
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче