Commit 4460b85a authored by neis's avatar neis Committed by Commit bot

[proxies] Add missing condition to GetProperty consistency check.

BUG=v8:1543
LOG=N
R=cbruni@chromium.org,jkummerow@chromium.org

Review URL: https://codereview.chromium.org/1519073002

Cr-Commit-Position: refs/heads/master@{#32832}
parent 28e61d5a
......@@ -805,7 +805,8 @@ MaybeHandle<Object> JSProxy::GetProperty(Isolate* isolate,
inconsistent =
inconsistent ||
(PropertyDescriptor::IsAccessorDescriptor(&target_desc) &&
!target_desc.configurable() && target_desc.get()->IsUndefined());
!target_desc.configurable() && target_desc.get()->IsUndefined() &&
!trap_result->IsUndefined());
if (inconsistent) {
THROW_NEW_ERROR(
isolate,
......
......@@ -52,7 +52,7 @@
(function testFailingInvariant() {
var target = {};
var handler = { get: function(){ return "value" }}
var handler = { get: function(r, p){ if (p != "key4") return "value" }}
var proxy = new Proxy(target, handler);
assertEquals("value", proxy.property);
assertEquals("value", proxy.key);
......@@ -92,6 +92,14 @@
assertThrows(function(){ proxy.key }, TypeError);
assertEquals("value", proxy.key2);
assertThrows(function(){ proxy.key3 }, TypeError);
// Define a non-configurable setter without a corresponding getter on the
// target for which the handler will return undefined.
Object.defineProperty(target, "key4", {
configurable: false,
set: function() { }
});
assertSame(undefined, proxy.key4);
})();
(function testGetInternalIterators() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment