Bug 1021066. Make named setters work even for non-overridebuiltins bindings over Xrays. r=bholley,jorendorff

This commit is contained in:
Boris Zbarsky
2014-07-23 01:06:33 -04:00
parent 90fd3b901e
commit d9044e7cd5
7 changed files with 114 additions and 4 deletions

View File

@@ -169,7 +169,7 @@ BaseProxyHandler::set(JSContext *cx, HandleObject proxy, HandleObject receiver,
if (desc.object()) {
// Check for read-only properties.
if (desc.isReadonly())
return strict ? Throw(cx, id, JSMSG_CANT_REDEFINE_PROP) : true;
return strict ? Throw(cx, id, JSMSG_READ_ONLY) : true;
if (!desc.setter()) {
// Be wary of the odd explicit undefined setter case possible through
// Object.defineProperty.