Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: src/api.cc

Issue 1036743004: add access checks to receivers on function callbacks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: super nit Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | src/builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index bf726784665b31f9773c4b0815108299332a24bc..320aa989260ae89ad49c1c0a78a0776cddd61f7f 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -953,6 +953,7 @@ static Local<FunctionTemplate> FunctionTemplateNew(
obj->set_length(length);
obj->set_undetectable(false);
obj->set_needs_access_check(false);
+ obj->set_accept_any_receiver(true);
if (!signature.IsEmpty())
obj->set_signature(*Utils::OpenHandle(*signature));
return Utils::ToLocal(obj);
@@ -1126,6 +1127,15 @@ void FunctionTemplate::SetClassName(Handle<String> name) {
}
+void FunctionTemplate::SetAcceptAnyReceiver(bool value) {
+ auto info = Utils::OpenHandle(this);
+ EnsureNotInstantiated(info, "v8::FunctionTemplate::SetAcceptAnyReceiver");
+ auto isolate = info->GetIsolate();
+ ENTER_V8(isolate);
+ info->set_accept_any_receiver(value);
+}
+
+
void FunctionTemplate::SetHiddenPrototype(bool value) {
auto info = Utils::OpenHandle(this);
EnsureNotInstantiated(info, "v8::FunctionTemplate::SetHiddenPrototype");
« no previous file with comments | « include/v8.h ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698