summaryrefslogtreecommitdiff
path: root/src/pipe_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-10-11 16:24:12 +0200
committerFedor Indutny <fedor@indutny.com>2014-10-12 02:09:16 +0400
commit97585b0d7ab0084d90faf6bded275b902d76857a (patch)
tree26853d875786c014e2e9ef5ed2ec18f7ed601775 /src/pipe_wrap.cc
parentb2e519983f1e92a874a74c11e82027955ef8909a (diff)
downloadandroid-node-v8-97585b0d7ab0084d90faf6bded275b902d76857a.tar.gz
android-node-v8-97585b0d7ab0084d90faf6bded275b902d76857a.tar.bz2
android-node-v8-97585b0d7ab0084d90faf6bded275b902d76857a.zip
src: remove unnecessary HandleScopes
API callback functions don't need to create a v8::HandleScope instance because V8 already creates one in the JS->C++ adapter frame. PR-URL: https://github.com/node-forward/node/pull/16 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r--src/pipe_wrap.cc16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 05472de5d9..49d09f43fb 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -127,7 +127,6 @@ void PipeWrap::New(const FunctionCallbackInfo<Value>& args) {
// Therefore we assert that we are not trying to call this as a
// normal function.
assert(args.IsConstructCall());
- HandleScope handle_scope(args.GetIsolate());
Environment* env = Environment::GetCurrent(args.GetIsolate());
new PipeWrap(env, args.This(), args[0]->IsTrue());
}
@@ -146,11 +145,7 @@ PipeWrap::PipeWrap(Environment* env, Handle<Object> object, bool ipc)
void PipeWrap::Bind(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
-
PipeWrap* wrap = Unwrap<PipeWrap>(args.Holder());
-
node::Utf8Value name(args[0]);
int err = uv_pipe_bind(&wrap->handle_, *name);
args.GetReturnValue().Set(err);
@@ -159,24 +154,15 @@ void PipeWrap::Bind(const FunctionCallbackInfo<Value>& args) {
#ifdef _WIN32
void PipeWrap::SetPendingInstances(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
-
PipeWrap* wrap = Unwrap<PipeWrap>(args.Holder());
-
int instances = args[0]->Int32Value();
-
uv_pipe_pending_instances(&wrap->handle_, instances);
}
#endif
void PipeWrap::Listen(const FunctionCallbackInfo<Value>& args) {
- Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
-
PipeWrap* wrap = Unwrap<PipeWrap>(args.Holder());
-
int backlog = args[0]->Int32Value();
int err = uv_listen(reinterpret_cast<uv_stream_t*>(&wrap->handle_),
backlog,
@@ -262,7 +248,6 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) {
void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
- HandleScope scope(env->isolate());
PipeWrap* wrap = Unwrap<PipeWrap>(args.Holder());
@@ -276,7 +261,6 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
- HandleScope scope(args.GetIsolate());
Environment* env = Environment::GetCurrent(args.GetIsolate());
PipeWrap* wrap = Unwrap<PipeWrap>(args.Holder());