}
void CallOnComplete(Local<Value> answer) {
- Context::Scope context_scope(env()->context());
HandleScope handle_scope(env()->isolate());
+ Context::Scope context_scope(env()->context());
Local<Value> argv[] = {
Integer::New(0, env()->isolate()),
answer
}
void CallOnComplete(Local<Value> answer, Local<Value> family) {
- Context::Scope context_scope(env()->context());
HandleScope handle_scope(env()->isolate());
+ Context::Scope context_scope(env()->context());
Local<Value> argv[] = {
Integer::New(0, env()->isolate()),
answer,
void ParseError(int status) {
assert(status != ARES_SUCCESS);
- Context::Scope context_scope(env()->context());
HandleScope handle_scope(env()->isolate());
+ Context::Scope context_scope(env()->context());
Local<Value> arg;
switch (status) {
#define V(code) \
GetAddrInfoReqWrap* req_wrap = static_cast<GetAddrInfoReqWrap*>(req->data);
Environment* env = req_wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> argv[] = {
Integer::New(status, node_isolate),
using_smalloc_alloc_cb_(false),
context_(context->GetIsolate(), context) {
// We'll be creating new objects so make sure we've entered the context.
- v8::Context::Scope context_scope(context);
v8::HandleScope handle_scope(isolate());
+ v8::Context::Scope context_scope(context);
set_binding_cache_object(v8::Object::New());
set_module_load_list_array(v8::Array::New());
RB_INIT(&cares_task_list_);
FSEventWrap* wrap = static_cast<FSEventWrap*>(handle->data);
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
assert(wrap->persistent().IsEmpty() == false);
// But the handle pointer should be gone.
assert(wrap->handle__ == NULL);
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Object> object = wrap->object();
if (wrap->flags_ & kCloseCallback) {
void EmitExit(Environment* env) {
// process.emit('exit')
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Object> process_object = env->process_object();
process_object->Set(FIXED_ONE_BYTE_STRING(node_isolate, "_exiting"),
True(node_isolate));
SSL* ssl = const_cast<SSL*>(ssl_);
Connection* conn = static_cast<Connection*>(SSL_get_app_data(ssl));
Environment* env = conn->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
if (where & SSL_CB_HANDSHAKE_START) {
conn->MakeCallback(env->onhandshakestart_string(), 0, NULL);
assert(status == 0);
PBKDF2Request* req = CONTAINER_OF(work_req, PBKDF2Request, work_req_);
Environment* env = req->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> argv[2];
EIO_PBKDF2After(req, argv);
req->MakeCallback(env->ondone_string(), ARRAY_SIZE(argv), argv);
req_wrap->ReleaseEarly(); // Free memory that's no longer used now.
Environment* env = req_wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
// there is always at least one argument. "error"
int argc = 1;
StatWatcher* wrap = static_cast<StatWatcher*>(handle->data);
assert(wrap->watcher_ == handle);
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> argv[] = {
BuildStatsObject(env, curr),
BuildStatsObject(env, prev),
void StatWatcher::Stop(const FunctionCallbackInfo<Value>& args) {
StatWatcher* wrap = Unwrap<StatWatcher>(args.This());
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
wrap->MakeCallback(env->onstop_string(), 0, NULL);
wrap->Stop();
}
ZCtx* ctx = CONTAINER_OF(work_req, ZCtx, work_req_);
Environment* env = ctx->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
// Acceptable error states depend on the type of zlib stream.
switch (ctx->err_) {
assert(&pipe_wrap->handle_ == reinterpret_cast<uv_pipe_t*>(handle));
Environment* env = pipe_wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
// We should not be getting this callback if someone as already called
// uv_close() on the handle.
assert(req_wrap->env() == wrap->env());
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
// The wrap and request objects should still be there.
assert(req_wrap->persistent().IsEmpty() == false);
assert(&wrap->process_ == handle);
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> argv[] = {
Number::New(node_isolate, static_cast<double>(exit_status)),
static void OnSignal(uv_signal_t* handle, int signum) {
SignalWrap* wrap = CONTAINER_OF(handle, SignalWrap, handle_);
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> arg = Integer::New(signum, env->isolate());
wrap->MakeCallback(env->onsignal_string(), 1, &arg);
StreamWrap* wrap = req_wrap->wrap();
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
// The wrap and request objects should still be there.
assert(req_wrap->persistent().IsEmpty() == false);
assert(req_wrap->persistent().IsEmpty() == false);
assert(wrap->persistent().IsEmpty() == false);
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Object> req_wrap_obj = req_wrap->object();
Local<Value> argv[3] = {
const uv_buf_t* buf,
uv_handle_type pending) {
Environment* env = wrap()->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> argv[] = {
Integer::New(nread, node_isolate),
assert(&tcp_wrap->handle_ == reinterpret_cast<uv_tcp_t*>(handle));
Environment* env = tcp_wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
// We should not be getting this callback if someone as already called
// uv_close() on the handle.
assert(req_wrap->env() == wrap->env());
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
// The wrap and request objects should still be there.
assert(req_wrap->persistent().IsEmpty() == false);
static void OnTimeout(uv_timer_t* handle, int status) {
TimerWrap* wrap = static_cast<TimerWrap*>(handle->data);
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> argv[1] = { Integer::New(status, node_isolate) };
wrap->MakeCallback(kOnTimeout, ARRAY_SIZE(argv), argv);
}
return;
// Notify about error
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> arg = String::Concat(
FIXED_ONE_BYTE_STRING(node_isolate, "write cb error, status: "),
Integer::New(status, node_isolate)->ToString());
if (!hello_parser_.IsEnded())
return;
- Context::Scope context_scope(env()->context());
HandleScope handle_scope(env()->isolate());
+ Context::Scope context_scope(env()->context());
assert(ssl_ != NULL);
return true;
}
- Context::Scope context_scope(env()->context());
HandleScope handle_scope(env()->isolate());
+ Context::Scope context_scope(env()->context());
// Error or partial write
int err;
if (i != count) {
int err;
- Context::Scope context_scope(env()->context());
HandleScope handle_scope(env()->isolate());
+ Context::Scope context_scope(env()->context());
Handle<Value> arg = GetSSLError(written, &err);
if (!arg.IsEmpty()) {
MakeCallback(env()->onerror_string(), 1, &arg);
if (nread < 0) {
// Error should be emitted only after all data was read
ClearOut();
- Context::Scope context_scope(env()->context());
HandleScope handle_scope(env()->isolate());
+ Context::Scope context_scope(env()->context());
Local<Value> arg = Integer::New(nread, node_isolate);
wrap()->MakeCallback(env()->onread_string(), 1, &arg);
return;
SendWrap* req_wrap = static_cast<SendWrap*>(req->data);
if (req_wrap->have_callback()) {
Environment* env = req_wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Value> arg = Integer::New(status, node_isolate);
req_wrap->MakeCallback(env->oncomplete_string(), 1, &arg);
}
UDPWrap* wrap = static_cast<UDPWrap*>(handle->data);
Environment* env = wrap->env();
- Context::Scope context_scope(env->context());
HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
Local<Object> wrap_obj = wrap->object();
Local<Value> argv[] = {