Commit a32096c4 authored by cbruni's avatar cbruni Committed by Commit bot

[runtime] [proxy] Remove JSProxy::CallTrap

LOG=n
BUG=v8:1543

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

Cr-Commit-Position: refs/heads/master@{#32557}
parent 324ab707
......@@ -4835,36 +4835,11 @@ Maybe<PropertyAttributes> JSProxy::GetPropertyAttributes(LookupIterator* it) {
MaybeHandle<Object> JSProxy::GetTrap(Handle<JSProxy> proxy,
Handle<String> trap) {
Handle<String> trap_name) {
DCHECK(!proxy->IsRevoked());
Isolate* isolate = proxy->GetIsolate();
Handle<JSReceiver> handler(JSReceiver::cast(proxy->handler()), isolate);
return Object::GetMethod(handler, trap);
}
MaybeHandle<Object> JSProxy::CallTrap(Handle<JSProxy> proxy,
const char* name,
Handle<Object> derived,
int argc,
Handle<Object> argv[]) {
Isolate* isolate = proxy->GetIsolate();
Handle<Object> handler(proxy->handler(), isolate);
Handle<String> trap_name = isolate->factory()->InternalizeUtf8String(name);
Handle<Object> trap;
ASSIGN_RETURN_ON_EXCEPTION(isolate, trap, GetTrap(proxy, trap_name), Object);
if (trap->IsUndefined()) {
if (derived.is_null()) {
THROW_NEW_ERROR(isolate,
NewTypeError(MessageTemplate::kProxyHandlerTrapMissing,
handler, trap_name),
Object);
}
trap = Handle<Object>(derived);
}
return Execution::Call(isolate, trap, handler, argc, argv);
return Object::GetMethod(handler, trap_name);
}
......
......@@ -9587,12 +9587,6 @@ class JSProxy: public JSReceiver {
MUST_USE_RESULT static MaybeHandle<Object> GetTrap(Handle<JSProxy> proxy,
Handle<String> trap);
// Invoke a trap by name. If the trap does not exist on this's handler,
// but derived_trap is non-NULL, invoke that instead. May cause GC.
MUST_USE_RESULT static MaybeHandle<Object> CallTrap(
Handle<JSProxy> proxy, const char* name, Handle<Object> derived_trap,
int argc, Handle<Object> args[]);
DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy);
};
......
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