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

Unified Diff: src/api.cc

Issue 11631002: Extend API to allow setting length property for function templates. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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/factory.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 0a6d25baebb27cc4859918703f7540622f45cf32..4966f9b1d9758eab0ab66641d40460174f8e2e9b 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1070,6 +1070,7 @@ Local<FunctionTemplate> FunctionTemplate::New(InvocationCallback callback,
if (data.IsEmpty()) data = v8::Undefined();
Utils::ToLocal(obj)->SetCallHandler(callback, data);
}
+ obj->set_length(0);
Yang 2012/12/19 09:14:45 We have this Signature object (third argument in t
rossberg 2012/12/19 10:21:50 Interesting idea. But as discussed offline, it's p
obj->set_undetectable(false);
obj->set_needs_access_check(false);
@@ -1240,6 +1241,14 @@ Local<ObjectTemplate> FunctionTemplate::InstanceTemplate() {
}
+void FunctionTemplate::SetLength(int length) {
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
+ if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetLength()")) return;
+ ENTER_V8(isolate);
+ Utils::OpenHandle(this)->set_length(length);
+}
+
+
void FunctionTemplate::SetClassName(Handle<String> name) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetClassName()")) return;
« no previous file with comments | « include/v8.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698