| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index 26ab64552fc344fff7be569d3f43b365650c4d6f..b1d5f1453c1a6aa62e760db7df455dc3a6aa1da2 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -2196,6 +2196,31 @@ MaybeObject* JSReceiver::SetProperty(LookupResult* result,
|
| }
|
|
|
|
|
| +bool JSProxy::HasPropertyWithHandler(String* name_raw) {
|
| + Isolate* isolate = GetIsolate();
|
| + HandleScope scope(isolate);
|
| + Handle<Object> receiver(this);
|
| + Handle<Object> name(name_raw);
|
| + Handle<Object> handler(this->handler());
|
| +
|
| + // Extract trap function.
|
| + Handle<String> trap_name = isolate->factory()->LookupAsciiSymbol("has");
|
| + Handle<Object> trap(v8::internal::GetProperty(handler, trap_name));
|
| + if (trap->IsUndefined()) {
|
| + trap = isolate->derived_has_trap();
|
| + }
|
| +
|
| + // Call trap function.
|
| + Object** args[] = { name.location() };
|
| + bool has_exception;
|
| + Handle<Object> result =
|
| + Execution::Call(trap, handler, ARRAY_SIZE(args), args, &has_exception);
|
| + if (has_exception) return Failure::Exception();
|
| +
|
| + return result->ToBoolean()->IsTrue();
|
| +}
|
| +
|
| +
|
| MUST_USE_RESULT MaybeObject* JSProxy::SetPropertyWithHandler(
|
| String* name_raw,
|
| Object* value_raw,
|
| @@ -2301,6 +2326,18 @@ MUST_USE_RESULT PropertyAttributes JSProxy::GetPropertyAttributeWithHandler(
|
| }
|
|
|
|
|
| +void JSProxy::Fix() {
|
| + Isolate* isolate = GetIsolate();
|
| + HandleScope scope(isolate);
|
| + Handle<JSProxy> self(this);
|
| +
|
| + isolate->factory()->BecomeJSObject(self);
|
| + ASSERT(IsJSObject());
|
| + // TODO(rossberg): recognize function proxies.
|
| +}
|
| +
|
| +
|
| +
|
| MaybeObject* JSObject::SetPropertyForResult(LookupResult* result,
|
| String* name,
|
| Object* value,
|
|
|