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

Unified Diff: src/bootstrapper.cc

Issue 2201823002: Make CallSite constructor inaccessible from JS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@get-stack-trace-line
Patch Set: Revert "CHECK invalid arguments to CallSite constructor" Created 4 years, 4 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 | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 6fd5917f1a95a48a9cb7ce5c3c6cdd8704006615..39840310288d26d77d0b2cb56fe8458885977345 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2644,9 +2644,13 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
{ // -- C a l l S i t e
// Builtin functions for CallSite.
+ // CallSites are a special case; the constructor is for our private use
+ // only, therefore we set it up as a builtin that throws. Internally, we use
+ // CallSiteUtils::Construct to create CallSite objects.
+
Handle<JSFunction> callsite_fun = InstallFunction(
container, "CallSite", JS_OBJECT_TYPE, JSObject::kHeaderSize,
- isolate->initial_object_prototype(), Builtins::kCallSiteConstructor);
+ isolate->initial_object_prototype(), Builtins::kUnsupportedThrower);
callsite_fun->shared()->DontAdaptArguments();
callsite_fun->shared()->set_native(true);
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698