Index: src/ic/ic.cc |
diff --git a/src/ic/ic.cc b/src/ic/ic.cc |
index bd5338a694e34e563269d2a1072eec6544471420..68483ef4fda7a4e0b33bc097c23120af0464bf39 100644 |
--- a/src/ic/ic.cc |
+++ b/src/ic/ic.cc |
@@ -2615,12 +2615,17 @@ RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptorOnly) { |
DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength); |
Handle<Name> name = |
args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); |
- Handle<JSObject> receiver = |
- args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); |
+ Handle<Object> receiver = |
+ args.at<Object>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); |
Handle<JSObject> holder = |
args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); |
HandleScope scope(isolate); |
+ if (!receiver->IsJSReceiver()) { |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, receiver, Object::ConvertReceiver(isolate, receiver)); |
+ } |
+ |
InterceptorInfo* interceptor = holder->GetNamedInterceptor(); |
PropertyCallbackArguments arguments(isolate, interceptor->data(), *receiver, |
*holder, Object::DONT_THROW); |
@@ -2646,11 +2651,16 @@ RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptor) { |
DCHECK(args.length() == NamedLoadHandlerCompiler::kInterceptorArgsLength); |
Handle<Name> name = |
args.at<Name>(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex); |
- Handle<JSObject> receiver = |
- args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); |
+ Handle<Object> receiver = |
+ args.at<Object>(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex); |
Handle<JSObject> holder = |
args.at<JSObject>(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex); |
+ if (!receiver->IsJSReceiver()) { |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, receiver, Object::ConvertReceiver(isolate, receiver)); |
+ } |
+ |
InterceptorInfo* interceptor = holder->GetNamedInterceptor(); |
PropertyCallbackArguments arguments(isolate, interceptor->data(), *receiver, |
*holder, Object::DONT_THROW); |