Lines Matching refs:env

4 #include "env-inl.h"
26 JSStream::JSStream(Environment* env, Local<Object> obj)
27 : AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM),
28 StreamBase(env) {
45 HandleScope scope(env()->isolate());
46 Context::Scope context_scope(env()->context());
47 TryCatchScope try_catch(env());
49 if (!MakeCallback(env()->isclosing_string(), 0, nullptr).ToLocal(&value)) {
51 errors::TriggerUncaughtException(env()->isolate(), try_catch);
59 HandleScope scope(env()->isolate());
60 Context::Scope context_scope(env()->context());
61 TryCatchScope try_catch(env());
64 if (!MakeCallback(env()->onreadstart_string(), 0, nullptr).ToLocal(&value) ||
65 !value->Int32Value(env()->context()).To(&value_int)) {
67 errors::TriggerUncaughtException(env()->isolate(), try_catch);
74 HandleScope scope(env()->isolate());
75 Context::Scope context_scope(env()->context());
76 TryCatchScope try_catch(env());
79 if (!MakeCallback(env()->onreadstop_string(), 0, nullptr).ToLocal(&value) ||
80 !value->Int32Value(env()->context()).To(&value_int)) {
82 errors::TriggerUncaughtException(env()->isolate(), try_catch);
89 HandleScope scope(env()->isolate());
90 Context::Scope context_scope(env()->context());
96 TryCatchScope try_catch(env());
99 if (!MakeCallback(env()->onshutdown_string(),
102 !value->Int32Value(env()->context()).To(&value_int)) {
104 errors::TriggerUncaughtException(env()->isolate(), try_catch);
116 HandleScope scope(env()->isolate());
117 Context::Scope context_scope(env()->context());
122 Buffer::Copy(env(), bufs[i].base, bufs[i].len).ToLocalChecked();
127 Array::New(env()->isolate(), bufs_arr.out(), count)
130 TryCatchScope try_catch(env());
133 if (!MakeCallback(env()->onwrite_string(),
136 !value->Int32Value(env()->context()).To(&value_int)) {
138 errors::TriggerUncaughtException(env()->isolate(), try_catch);
149 Environment* env = Environment::GetCurrent(args);
150 new JSStream(env, args.This());
200 Environment* env = Environment::GetCurrent(context);
201 Isolate* isolate = env->isolate();
206 t->Inherit(AsyncWrap::GetConstructorTemplate(env));
213 StreamBase::AddMethods(env, t);