Lines Matching defs:args
154 static void SetupHooks(const FunctionCallbackInfo<Value>& args) {
155 Environment* env = Environment::GetCurrent(args);
157 CHECK(args[0]->IsObject());
165 Local<Object> fn_obj = args[0].As<Object>();
185 static void SetPromiseHooks(const FunctionCallbackInfo<Value>& args) {
186 Environment* env = Environment::GetCurrent(args);
189 args[0]->IsFunction() ? args[0].As<Function>() : Local<Function>(),
190 args[1]->IsFunction() ? args[1].As<Function>() : Local<Function>(),
191 args[2]->IsFunction() ? args[2].As<Function>() : Local<Function>(),
192 args[3]->IsFunction() ? args[3].As<Function>() : Local<Function>());
230 static void RegisterDestroyHook(const FunctionCallbackInfo<Value>& args) {
231 CHECK(args[0]->IsObject());
232 CHECK(args[1]->IsNumber());
233 CHECK(args.Length() == 2 || args[2]->IsObject());
235 Isolate* isolate = args.GetIsolate();
237 p->asyncId = args[1].As<Number>()->Value();
238 p->env = Environment::GetCurrent(args);
239 p->target.Reset(isolate, args[0].As<Object>());
240 if (args.Length() > 2) {
241 p->propBag.Reset(isolate, args[2].As<Object>());
247 void AsyncWrap::GetAsyncId(const FunctionCallbackInfo<Value>& args) {
249 args.GetReturnValue().Set(kInvalidAsyncId);
250 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
251 args.GetReturnValue().Set(wrap->get_async_id());
255 void AsyncWrap::PushAsyncContext(const FunctionCallbackInfo<Value>& args) {
256 Environment* env = Environment::GetCurrent(args);
257 // No need for CHECK(IsNumber()) on args because if FromJust() doesn't fail
259 double async_id = args[0]->NumberValue(env->context()).FromJust();
260 double trigger_async_id = args[1]->NumberValue(env->context()).FromJust();
265 void AsyncWrap::PopAsyncContext(const FunctionCallbackInfo<Value>& args) {
266 Environment* env = Environment::GetCurrent(args);
267 double async_id = args[0]->NumberValue(env->context()).FromJust();
268 args.GetReturnValue().Set(env->async_hooks()->pop_async_context(async_id));
273 const FunctionCallbackInfo<Value>& args) {
274 Environment* env = Environment::GetCurrent(args);
276 if (!args[0]->Uint32Value(env->context()).To(&index)) return;
277 args.GetReturnValue().Set(
282 void AsyncWrap::ClearAsyncIdStack(const FunctionCallbackInfo<Value>& args) {
283 Environment* env = Environment::GetCurrent(args);
288 void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) {
289 CHECK(args[0]->IsObject());
292 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
294 Local<Object> resource = args[0].As<Object>();
296 args[1]->IsNumber() ? args[1].As<Number>()->Value() : kInvalidAsyncId;
301 void AsyncWrap::GetProviderType(const FunctionCallbackInfo<Value>& args) {
303 args.GetReturnValue().Set(AsyncWrap::PROVIDER_NONE);
304 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
305 args.GetReturnValue().Set(wrap->provider_type());
320 void AsyncWrap::QueueDestroyAsyncId(const FunctionCallbackInfo<Value>& args) {
321 CHECK(args[0]->IsNumber());
323 Environment::GetCurrent(args),
324 args[0].As<Number>()->Value());
327 void AsyncWrap::SetCallbackTrampoline(const FunctionCallbackInfo<Value>& args) {
328 Environment* env = Environment::GetCurrent(args);
330 if (args[0]->IsFunction()) {
331 env->set_async_hooks_callback_trampoline(args[0].As<Function>());