mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
7eb62e9704
commit
ed885d50a9
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user