Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

remove --allow-native-syntax flag during worker initialization #242

Merged
merged 1 commit into from
Jun 4, 2018
Merged
Changes from all commits
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
10 changes: 1 addition & 9 deletions src/zone/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,9 @@ void Worker::WorkerThreadFunc(const settings::ZoneSettings& settings) {
worker_argv[3] = workId.c_str();
node::Environment* env = node::CreateEnvironment(isolate_data.get(), context, 4, worker_argv, 0, nullptr);

// Problem: it would impact relevant execution behavior because,
// 1. this logic couples with node bootstrapping logic,
// 2. the flag is a setting shared at process level.
// TODO : Re-evaluate the impact and figure out a solid solution at node.js / napa.js.
// node::LoadEnvironment need access to V8 intrinsics by flag '--allow_natives_syntax'.
// If the flag haven't been specified when launching node.js,
// it will be disabled again during node bootstrapping.
// TODO : Remove the lock here when process.dlopen becomes thread-safe.
{
std::lock_guard<std::mutex> lock(environment_loading_mutext);
const char allow_natives_syntax[] = "--allow_natives_syntax";
v8::V8::SetFlagsFromString(allow_natives_syntax, sizeof(allow_natives_syntax) - 1);
node::LoadEnvironment(env);
}

Expand Down