Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 71867e1962acef52f03b2d97ea55cf60be0c3e42..2457a956a7a801c59f6885aad59d3ca79b150bca 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -1044,6 +1044,17 @@ MUST_USE_RESULT static MaybeHandle<Object> HandleApiCallHelper( |
DCHECK(!args[0]->IsNull()); |
if (args[0]->IsUndefined()) args[0] = function->global_proxy(); |
+ if (!is_construct && !fun_data->accept_any_receiver()) { |
+ Handle<Object> receiver(&args[0]); |
+ if (receiver->IsJSObject() && receiver->IsAccessCheckNeeded()) { |
+ Handle<JSObject> js_receiver = Handle<JSObject>::cast(receiver); |
+ if (!isolate->MayAccess(js_receiver)) { |
+ isolate->ReportFailedAccessCheck(js_receiver); |
+ RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); |
+ } |
+ } |
+ } |
+ |
Object* raw_holder = fun_data->GetCompatibleReceiver(isolate, args[0]); |
if (raw_holder->IsNull()) { |