Lines Matching refs:env
23 #include "env-inl.h"
63 Environment* env = wrap->env();
66 if (!args[0]->Int32Value(env->context()).To(&flag)) {
76 SendWrap(Environment* env, Local<Object> req_wrap_obj, bool have_callback);
89 SendWrap::SendWrap(Environment* env,
92 : ReqWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_UDPSENDWRAP),
131 void UDPWrapBase::AddMethods(Environment* env, Local<FunctionTemplate> t) {
132 SetProtoMethod(env->isolate(), t, "recvStart", RecvStart);
133 SetProtoMethod(env->isolate(), t, "recvStop", RecvStop);
136 UDPWrap::UDPWrap(Environment* env, Local<Object> object)
137 : HandleWrap(env,
144 int r = uv_udp_init(env->event_loop(), &handle_);
155 Environment* env = Environment::GetCurrent(context);
156 Isolate* isolate = env->isolate();
170 t->PrototypeTemplate()->SetAccessorProperty(env->fd_string(),
175 UDPWrapBase::AddMethods(env, t);
213 t->Inherit(HandleWrap::GetConstructorTemplate(env));
216 env->set_udp_constructor_function(t->GetFunction(context).ToLocalChecked());
220 BaseObject::MakeLazilyInitializedJSTemplate(env);
221 swt->Inherit(AsyncWrap::GetConstructorTemplate(env));
228 env->constants_string(),
235 Environment* env = Environment::GetCurrent(args);
236 new UDPWrap(env, args.This());
342 Environment* env = Environment::GetCurrent(args);
355 env->CollectUVExceptionInfo(args[2], UV_EINVAL, uv_func_name);
369 env->CollectUVExceptionInfo(args[2], err, uv_func_name);
491 Environment* env = Environment::GetCurrent(args);
524 if (!chunks->Get(env->context(), i).ToLocal(&chunk)) return;
536 node::Utf8Value address(env->isolate(), args[4]);
566 if (!UNLIKELY(env()->options()->test_udp_no_try_send)) {
615 SendWrap* req_wrap = new SendWrap(env(),
674 Environment* env = req_wrap->env();
675 HandleScope handle_scope(env->isolate());
676 Context::Scope context_scope(env->context());
678 Integer::New(env->isolate(), status),
679 Integer::New(env->isolate(), req_wrap->msg_size),
681 req_wrap->MakeCallback(env->oncomplete_string(), 2, arg);
695 return env()->allocate_managed_buffer(suggested_size);
711 Environment* env = this->env();
712 Isolate* isolate = env->isolate();
713 std::unique_ptr<BackingStore> bs = env->release_managed_buffer(buf_);
719 Context::Scope context_scope(env->context());
728 MakeCallback(env->onmessage_string(), arraysize(argv), argv);
741 TryCatchScope try_catch(env);
742 if (!AddressToJS(env, addr).ToLocal(&address)) {
751 MakeCallback(env->onerror_string(), arraysize(argv), argv);
760 TryCatchScope try_catch(env);
761 if (!Buffer::New(env, ab, 0, ab->ByteLength()).ToLocal(&argv[2])) {
770 MakeCallback(env->onerror_string(), arraysize(argv), argv);
776 MakeCallback(env->onmessage_string(), arraysize(argv), argv);
779 MaybeLocal<Object> UDPWrap::Instantiate(Environment* env,
785 CHECK_EQ(env->udp_constructor_function().IsEmpty(), false);
786 return env->udp_constructor_function()->NewInstance(env->context());