# HG changeset patch # User Sara # Date 1392492997 28800 # Node ID 2fcaa90d17fc27a5400e674e0bad680fa90e9200 # Parent ccedccf5a3e2ad9c0eb54b55293a1842f299cdc6 y diff -r ccedccf5a3e2 -r 2fcaa90d17fc V8_tests/Passing_Context_and_compiledScript_to_threads/OneContextAfterOther.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/V8_tests/Passing_Context_and_compiledScript_to_threads/OneContextAfterOther.cpp Sat Feb 15 11:36:37 2014 -0800 @@ -0,0 +1,48 @@ +#include +#include +using namespace v8; +Isolate* isolate; +int main(int argc, char* argv[]) { + isolate = Isolate::New(); + { + if(isolate == NULL){ + printf("Error"); + return 0; + } + Locker locker(isolate); + Isolate::Scope isolate_scope(isolate); + // Create a stack-allocated handle scope. + HandleScope handle_scope(isolate); + // Create a new context. + Handle context1 = Context::New(isolate); + // Enter the context for compiling and running the hello world script. + Context::Scope context_scope1(context1); + { + // Create a string containing the JavaScript source code + Handle source1 = String::NewFromUtf8(isolate, "'Hello' + ', World!'"); + // Compile the source code. + Handle