Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node api to create isolate/context #22

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
node api to create isolate/context
  • Loading branch information
helloshuangzi committed May 9, 2018
commit 7f1a45b90b4af928d42a8499e69b9695df16dfc3
6 changes: 2 additions & 4 deletions src/zone/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ void Worker::Schedule(std::shared_ptr<Task> task) {

void Worker::WorkerThreadFunc(const settings::ZoneSettings& settings) {
// Create Isolate.
v8::Isolate::CreateParams params;
params.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator();
v8::Isolate* isolate = v8::Isolate::New(params);
v8::Isolate* isolate = node::NewIsolate();
NAPA_ASSERT(isolate, "Failed to create v8 isolate for worker.");
_impl->isolate = isolate;

Expand All @@ -166,7 +164,7 @@ void Worker::WorkerThreadFunc(const settings::ZoneSettings& settings) {
NAPA_DEBUG("Worker", "(id=%u) Setup completed.", _impl->id);

// Create Context.
v8::Local<v8::Context> context = v8::Context::New(isolate);
v8::Local<v8::Context> context = node::NewContext(isolate);
v8::Context::Scope context_scope(context);

// Create node::Environment.
Expand Down