зеркало из https://github.com/mozilla/gecko-dev.git
Property deletion should be silent for ECMA-conformant versions of JS.
This commit is contained in:
Родитель
4cbc340e2c
Коммит
9b0324a6af
|
@ -556,8 +556,16 @@ JavaObject_setAttributes(JSContext *cx, JSObject *obj, jsid id,
|
|||
static JSBool
|
||||
JavaObject_deleteProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
|
||||
{
|
||||
JS_ReportError(cx, "Properties of JavaObject objects may not be deleted");
|
||||
return JS_FALSE;
|
||||
JSVersion version = JS_GetVersion(cx);
|
||||
|
||||
if (!JSVERSION_IS_ECMA(version)) {
|
||||
JS_ReportError(cx, "Properties of JavaObject objects may not be deleted");
|
||||
return JS_FALSE;
|
||||
} else {
|
||||
/* Attempts to delete permanent properties are silently ignored
|
||||
by ECMAScript. */
|
||||
return JS_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static JSBool
|
||||
|
|
Загрузка…
Ссылка в новой задаче