Lines Matching refs:env

22 #include "env-inl.h"
55 Environment* env = Environment::GetCurrent(context);
56 Isolate* isolate = env->isolate();
61 constructor->Inherit(HandleWrap::GetConstructorTemplate(env));
79 Environment* env = Environment::GetCurrent(args);
80 new ProcessWrap(env, args.This());
83 ProcessWrap(Environment* env, Local<Object> object)
84 : HandleWrap(env,
91 static uv_stream_t* StreamForWrap(Environment* env, Local<Object> stdio) {
92 Local<String> handle_key = env->handle_string();
95 stdio->Get(env->context(), handle_key).ToLocalChecked().As<Object>();
97 uv_stream_t* stream = LibuvStreamWrap::From(env, handle)->stream();
102 static void ParseStdioOptions(Environment* env,
105 Local<Context> context = env->context();
106 Local<String> stdio_key = env->stdio_string();
118 stdio->Get(context, env->type_string()).ToLocalChecked();
120 if (type->StrictEquals(env->ignore_string())) {
122 } else if (type->StrictEquals(env->pipe_string())) {
125 options->stdio[i].data.stream = StreamForWrap(env, stdio);
126 } else if (type->StrictEquals(env->overlapped_string())) {
130 options->stdio[i].data.stream = StreamForWrap(env, stdio);
131 } else if (type->StrictEquals(env->wrap_string())) {
133 options->stdio[i].data.stream = StreamForWrap(env, stdio);
135 Local<String> fd_key = env->fd_string();
146 Environment* env = Environment::GetCurrent(args);
147 Local<Context> context = env->context();
152 args[0]->ToObject(env->context()).ToLocalChecked();
161 js_options->Get(context, env->uid_string()).ToLocalChecked();
171 js_options->Get(context, env->gid_string()).ToLocalChecked();
183 js_options->Get(context, env->file_string()).ToLocalChecked();
185 node::Utf8Value file(env->isolate(), file_v);
190 js_options->Get(context, env->args_string()).ToLocalChecked();
199 node::Utf8Value arg(env->isolate(),
209 js_options->Get(context, env->cwd_string()).ToLocalChecked();
210 node::Utf8Value cwd(env->isolate(),
216 // options.env
218 js_options->Get(context, env->env_pairs_string()).ToLocalChecked();
223 options.env = new char*[envc + 1]; // Heap allocated to detect errors.
225 node::Utf8Value pair(env->isolate(),
227 options.env[i] = strdup(*pair);
228 CHECK_NOT_NULL(options.env[i]);
230 options.env[envc] = nullptr;
234 ParseStdioOptions(env, js_options, &options);
238 js_options->Get(context, env->windows_hide_string()).ToLocalChecked();
244 if (env->hide_console_windows()) {
250 js_options->Get(context, env->windows_verbatim_arguments_string())
259 js_options->Get(context, env->detached_string()).ToLocalChecked();
265 int err = uv_spawn(env->event_loop(), &wrap->process_, &options);
270 wrap->object()->Set(context, env->pid_string(),
271 Integer::New(env->isolate(),
280 if (options.env) {
281 for (int i = 0; options.env[i]; i++) free(options.env[i]);
282 delete [] options.env;
291 Environment* env = Environment::GetCurrent(args);
294 int signal = args[0]->Int32Value(env->context()).FromJust();
305 Environment* env = wrap->env();
306 HandleScope handle_scope(env->isolate());
307 Context::Scope context_scope(env->context());
310 Number::New(env->isolate(), static_cast<double>(exit_status)),
311 OneByteString(env->isolate(), signo_string(term_signal))
314 wrap->MakeCallback(env->onexit_string(), arraysize(argv), argv);