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

Unified Diff: include/v8.h

Issue 2127523003: Updating the code example in FunctionTemplate class documentation (Closed) Base URL: git@github.com:danbev/v8.git@master
Patch Set: Adding myself to the AUTHORS file Created 4 years, 5 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 83da77b3d145f2b3532c366306d5ff063da17805..ad78922ee8c6d4a3d95c56ce54312b00032f18cf 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4417,17 +4417,21 @@ typedef bool (*AccessCheckCallback)(Local<Context> accessing_context,
* The following example shows how to use a FunctionTemplate:
*
* \code
- * v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New();
- * t->Set("func_property", v8::Number::New(1));
+ * v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate);
+ * t->Set(isolate, "func_property", v8::Number::New(isolate, 1));
*
* v8::Local<v8::Template> proto_t = t->PrototypeTemplate();
- * proto_t->Set("proto_method", v8::FunctionTemplate::New(InvokeCallback));
- * proto_t->Set("proto_const", v8::Number::New(2));
+ * proto_t->Set(isolate,
+ * "proto_method",
+ * v8::FunctionTemplate::New(isolate, InvokeCallback));
+ * proto_t->Set(isolate, "proto_const", v8::Number::New(isolate, 2));
*
* v8::Local<v8::ObjectTemplate> instance_t = t->InstanceTemplate();
- * instance_t->SetAccessor("instance_accessor", InstanceAccessorCallback);
- * instance_t->SetNamedPropertyHandler(PropertyHandlerCallback, ...);
- * instance_t->Set("instance_property", Number::New(3));
+ * instance_t->SetAccessor(String::NewFromUtf8(isolate, "instance_accessor"),
+ * InstanceAccessorCallback);
+ * instance_t->SetNamedPropertyHandler(PropertyHandlerCallback);
+ * instance_t->Set(String::NewFromUtf8(isolate, "instance_property"),
+ * Number::New(isolate, 3));
*
* v8::Local<v8::Function> function = t->GetFunction();
* v8::Local<v8::Object> instance = function->NewInstance();
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698