Bug 1113980 - Try to fix a bug with [[Set]] and old proxies. r=Waldo

This commit is contained in:
Tom Schuster 2015-01-01 16:42:41 +01:00
parent 47e92f2b3c
commit 453e2241bb
2 changed files with 14 additions and 2 deletions

View File

@ -0,0 +1,10 @@
var p = Proxy.create({
getOwnPropertyDescriptor: function() {
return {value: 1, configurable: true, writable: true};
},
defineProperty: function() {
}
}, null);
var o = Object.create(p);
o.a = 1;

View File

@ -182,8 +182,10 @@ js::SetPropertyIgnoringNamedGetter(JSContext *cx, const BaseProxyHandler *handle
}
desc.value().set(vp.get());
if (descIsOwn)
return handler->defineProperty(cx, receiver, id, desc);
if (descIsOwn) {
MOZ_ASSERT(desc.object() == proxy);
return handler->defineProperty(cx, proxy, id, desc);
}
return JSObject::defineGeneric(cx, receiver, id, desc.value(),
desc.getter(), desc.setter(), desc.attributes());
}