зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 741367 (Creating second XMLHttpRequest via Components.Constructor throws NS_ERROR_FAILURE): don't overwrite content-defined properties. r=bz.
--HG-- extra : rebase_source : f9c7fe34d4cde28cafea0536e305704e2dc04ff7
This commit is contained in:
Родитель
53f19cddef
Коммит
ae69faa3f8
|
@ -146,8 +146,14 @@ CreateInterfaceObject(JSContext* cx, JSObject* global, JSObject* receiver,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
JSBool alreadyDefined;
|
||||
if (!JS_AlreadyHasOwnProperty(cx, receiver, name, &alreadyDefined)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// This is Enumerable: False per spec.
|
||||
if (!JS_DefineProperty(cx, receiver, name, OBJECT_TO_JSVAL(constructor), NULL,
|
||||
if (!alreadyDefined &&
|
||||
!JS_DefineProperty(cx, receiver, name, OBJECT_TO_JSVAL(constructor), NULL,
|
||||
NULL, 0)) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче