# HG changeset patch # User Sara # Date 1391273460 28800 # Node ID a6cc4a802db6bc7854978cf43110b8fd967f723c # Parent 469c49d5aa0230391ad740ba2ae15f874a8cba28 the code diff -r 469c49d5aa02 -r a6cc4a802db6 V8/Hello_World.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/V8/Hello_World.cpp Sat Feb 01 08:51:00 2014 -0800 @@ -0,0 +1,31 @@ +#include + +using namespace v8; + +int main(int argc, char* argv[]) { + // Get the default Isolate created at startup. + Isolate* isolate = Isolate::GetCurrent(); + + // Create a stack-allocated handle scope. + HandleScope handle_scope(isolate); + + // Create a new context. + Handle context = Context::New(isolate); + + // Enter the context for compiling and running the hello world script. + Context::Scope context_scope(context); + + // Create a string containing the JavaScript source code. + Handle source = String::NewFromUtf8(isolate, "'Hello' + ', World!'"); + + // Compile the source code. + Handle