Bug 787070 - Expandos on the xray of DOM prototypes should have effect on xrays of DOM nodes, make Proxy::set throw for read-only properties. r=efaust.

--HG--
extra : rebase_source : 961e38d6c99cd22c7d7336cef744f41310751214
This commit is contained in:
Peter Van der Beken 2014-08-14 15:12:19 +02:00
parent 412db14000
commit 829813c222

View File

@ -321,6 +321,10 @@ Proxy::set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id
if (desc.object() && desc.setter() && desc.setter() != JS_StrictPropertyStub)
return CallSetter(cx, receiver, id, desc.setter(), desc.attributes(), strict, vp);
if (desc.isReadonly()) {
return strict ? Throw(cx, id, JSMSG_READ_ONLY) : true;
}
// Ok. Either there was no pre-existing property, or it was a value prop
// that we're going to shadow. Make a property descriptor and define it.
//