summaryrefslogtreecommitdiff
path: root/src/stream_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-11-11 10:53:00 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-11-12 22:06:48 +0100
commit27f115d715478b9a800927498ba606d4a62f927c (patch)
tree2a1c5b790d852f48f5547a72fa4e90ea146e004d /src/stream_wrap.cc
parentc0d62c207ee67492619bde4af46502b5a3ce6a66 (diff)
downloadandroid-node-v8-27f115d715478b9a800927498ba606d4a62f927c.tar.gz
android-node-v8-27f115d715478b9a800927498ba606d4a62f927c.tar.bz2
android-node-v8-27f115d715478b9a800927498ba606d4a62f927c.zip
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/stream_wrap.cc')
-rw-r--r--src/stream_wrap.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc
index 2274eff0f4..77797621d0 100644
--- a/src/stream_wrap.cc
+++ b/src/stream_wrap.cc
@@ -431,8 +431,8 @@ void StreamWrap::AfterWrite(uv_write_t* req, int status) {
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);
@@ -483,8 +483,8 @@ void StreamWrap::AfterShutdown(uv_shutdown_t* req, int status) {
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] = {
@@ -552,8 +552,8 @@ void StreamWrapCallbacks::DoRead(uv_stream_t* handle,
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),