diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-11 10:53:00 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-11-12 22:06:48 +0100 |
commit | 27f115d715478b9a800927498ba606d4a62f927c (patch) | |
tree | 2a1c5b790d852f48f5547a72fa4e90ea146e004d /src/pipe_wrap.cc | |
parent | c0d62c207ee67492619bde4af46502b5a3ce6a66 (diff) | |
download | node-new-27f115d715478b9a800927498ba606d4a62f927c.tar.gz |
src: fix Context::Scope usage
env->context() may or may not create a new Local. It currently does
not but don't depend on that behavior, create a HandleScope first.
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r-- | src/pipe_wrap.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index e5b6836050..d4f01ebf9e 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -181,8 +181,8 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) { 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. @@ -220,8 +220,8 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) { 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); |