Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 799cb76d1f4298e99c3356ae56dee96332e2c09e..d340dd45a7eebf339f62d50507a784c2e204c50e 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -2527,6 +2527,7 @@ MUST_USE_RESULT MaybeObject* JSProxy::SetPropertyWithHandlerIfDefiningSetter( |
*found = true; // except where defined otherwise... |
Isolate* isolate = GetHeap()->isolate(); |
Handle<JSProxy> proxy(this); |
+ Handle<Object> handler(this->handler()); // Trap might morph proxy. |
Handle<String> name(name_raw); |
Handle<Object> value(value_raw); |
Handle<Object> args[] = { name }; |
@@ -2550,7 +2551,9 @@ MUST_USE_RESULT MaybeObject* JSProxy::SetPropertyWithHandlerIfDefiningSetter( |
Handle<Object> configurable(v8::internal::GetProperty(desc, conf_name)); |
ASSERT(!isolate->has_pending_exception()); |
if (configurable->IsFalse()) { |
- Handle<Object> args[] = { Handle<Object>(proxy->handler()), proxy, name }; |
+ Handle<String> trap = |
+ isolate->factory()->LookupAsciiSymbol("getPropertyDescriptor"); |
+ Handle<Object> args[] = { handler, trap, name }; |
Handle<Object> error = isolate->factory()->NewTypeError( |
"proxy_prop_not_configurable", HandleVector(args, ARRAY_SIZE(args))); |
return isolate->Throw(*error); |
@@ -2630,6 +2633,7 @@ MUST_USE_RESULT PropertyAttributes JSProxy::GetPropertyAttributeWithHandler( |
Isolate* isolate = GetIsolate(); |
HandleScope scope(isolate); |
Handle<JSProxy> proxy(this); |
+ Handle<Object> handler(this->handler()); // Trap might morph proxy. |
Handle<JSReceiver> receiver(receiver_raw); |
Handle<Object> name(name_raw); |
@@ -2659,7 +2663,9 @@ MUST_USE_RESULT PropertyAttributes JSProxy::GetPropertyAttributeWithHandler( |
if (isolate->has_pending_exception()) return NONE; |
if (configurable->IsFalse()) { |
- Handle<Object> args[] = { Handle<Object>(proxy->handler()), proxy, name }; |
+ Handle<String> trap = |
+ isolate->factory()->LookupAsciiSymbol("getPropertyDescriptor"); |
+ Handle<Object> args[] = { handler, trap, name }; |
Handle<Object> error = isolate->factory()->NewTypeError( |
"proxy_prop_not_configurable", HandleVector(args, ARRAY_SIZE(args))); |
isolate->Throw(*error); |