Skip to content

Instantly share code, notes, and snippets.

@deepal
Created October 15, 2019 21:33
Show Gist options
  • Save deepal/0718367d870105555c71160c62fa94c4 to your computer and use it in GitHub Desktop.
Save deepal/0718367d870105555c71160c62fa94c4 to your computer and use it in GitHub Desktop.
Clone Parent thread's env variables
void Worker::CloneParentEnvVars(const FunctionCallbackInfo<Value>& args) {
Worker* w;
ASSIGN_OR_RETURN_UNWRAP(&w, args.This());
CHECK(w->thread_joined_); // The Worker has not started yet.
w->env_vars_ = w->env()->env_vars()->Clone(args.GetIsolate());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment