-
-
Save deepal/980ab6dabb1cb3ed824548e7b6df0df1 to your computer and use it in GitHub Desktop.
Simple example how V8 Function\Object Templates can be used
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a template for the global object and set the built-in global functions | |
Local<ObjectTemplate> global = ObjectTemplate::New(isolate); | |
global->Set( | |
String::NewFromUtf8(isolate, "log"), | |
FunctionTemplate::New(isolate, LogCallback) | |
); | |
// Each processor gets its own context so different processors do not affect each other | |
Persistent<Context> context = Context::New(isolate, NULL, global); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment