Lines Matching refs:env
2 #include "env-inl.h"
34 static Maybe<double> GetAssignedPromiseAsyncId(Environment* env,
38 if (!promise->Get(env->context(), id_symbol).ToLocal(&maybe_async_id)) {
42 ? maybe_async_id->NumberValue(env->context())
46 static Maybe<double> GetAssignedPromiseWrapAsyncId(Environment* env,
56 if (!promiseWrap.As<Object>()->Get(env->context(), id_symbol)
61 ? maybe_async_id->NumberValue(env->context())
76 Environment* env = Environment::GetCurrent(isolate);
78 if (env == nullptr || !env->can_call_into_js()) return;
80 Local<Function> callback = env->promise_reject_callback();
86 Local<Value> type = Number::New(env->isolate(), event);
118 TryCatchScope try_catch(env);
120 if (!GetAssignedPromiseAsyncId(env, promise, env->async_id_symbol())
122 if (!GetAssignedPromiseAsyncId(env, promise, env->trigger_async_id_symbol())
129 if (!GetAssignedPromiseWrapAsyncId(env, promise, env->async_id_symbol())
132 env, promise, env->trigger_async_id_symbol())
138 env->async_hooks()->push_async_context(
143 env->context(), Undefined(isolate), arraysize(args), args));
147 env->execution_async_id() == async_id) {
150 env->async_hooks()->pop_async_context(async_id);
158 PrintCaughtException(isolate, env->context(), try_catch);
164 Environment* env = Environment::GetCurrent(args);
165 Isolate* isolate = env->isolate();
174 Environment* env = Environment::GetCurrent(args);
175 env->context()->GetMicrotaskQueue()->PerformCheckpoint(env->isolate());
179 Environment* env = Environment::GetCurrent(args);
181 env->set_tick_callback_function(args[0].As<Function>());
186 Environment* env = Environment::GetCurrent(args);
189 env->set_promise_reject_callback(args[0].As<Function>());
196 Environment* env = Environment::GetCurrent(context);
197 Isolate* isolate = env->isolate();
202 target->Set(env->context(),
204 env->tick_info()->fields().GetJSArray()).Check();
212 target->Set(env->context(),