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

Unified Diff: src/api.cc

Issue 23561007: add uncached Function::New (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 22228c4e8b175b67db90b04b0089e023280822cc..1c2a2616f294acda876c4ee3f97e9ce407b2910a 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1076,6 +1076,7 @@ Local<FunctionTemplate> FunctionTemplate::New(
obj->set_length(length);
obj->set_undetectable(false);
obj->set_needs_access_check(false);
+ obj->set_do_not_cache(false);
if (!signature.IsEmpty())
obj->set_signature(*Utils::OpenHandle(*signature));
@@ -4189,6 +4190,18 @@ Local<v8::Value> Object::CallAsConstructor(int argc,
}
+Local<Function> Function::New(Isolate* v8_isolate,
+ FunctionCallback callback,
+ Local<Value> data,
+ int length) {
+ HandleScope scope(reinterpret_cast<Isolate*>(v8_isolate));
+ Local<FunctionTemplate> info =
+ FunctionTemplate::New(callback, data, Local<Signature>(), length);
+ Utils::OpenHandle(*info)->set_do_not_cache(true);
+ return scope.Close(info->GetFunction());
+}
+
+
Local<v8::Object> Function::NewInstance() const {
return NewInstance(0, NULL);
}

Powered by Google App Engine
This is Rietveld 408576698