diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-10-11 16:24:12 +0200 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-10-12 02:09:16 +0400 |
commit | 97585b0d7ab0084d90faf6bded275b902d76857a (patch) | |
tree | 26853d875786c014e2e9ef5ed2ec18f7ed601775 /src/node_zlib.cc | |
parent | b2e519983f1e92a874a74c11e82027955ef8909a (diff) | |
download | node-new-97585b0d7ab0084d90faf6bded275b902d76857a.tar.gz |
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/node_zlib.cc')
-rw-r--r-- | src/node_zlib.cc | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 4f0c938998..4a0161dcb6 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -128,8 +128,6 @@ class ZCtx : public AsyncWrap { static void Close(const FunctionCallbackInfo<Value>& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ZCtx* ctx = Unwrap<ZCtx>(args.Holder()); ctx->Close(); } @@ -138,8 +136,6 @@ class ZCtx : public AsyncWrap { // write(flush, in, in_off, in_len, out, out_off, out_len) template <bool async> static void Write(const FunctionCallbackInfo<Value>& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert(args.Length() == 7); ZCtx* ctx = Unwrap<ZCtx>(args.Holder()); @@ -224,7 +220,6 @@ class ZCtx : public AsyncWrap { static void AfterSync(ZCtx* ctx, const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); Local<Integer> avail_out = Integer::New(env->isolate(), ctx->strm_.avail_out); Local<Integer> avail_in = Integer::New(env->isolate(), @@ -370,7 +365,6 @@ class ZCtx : public AsyncWrap { } static void New(const FunctionCallbackInfo<Value>& args) { - HandleScope handle_scope(args.GetIsolate()); Environment* env = Environment::GetCurrent(args.GetIsolate()); if (args.Length() < 1 || !args[0]->IsInt32()) { @@ -388,7 +382,6 @@ class ZCtx : public AsyncWrap { // just pull the ints out of the args and call the other Init static void Init(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert((args.Length() == 4 || args.Length() == 5) && "init(windowBits, level, memLevel, strategy, [dictionary])"); @@ -429,7 +422,6 @@ class ZCtx : public AsyncWrap { static void Params(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); assert(args.Length() == 2 && "params(level, strategy)"); @@ -440,7 +432,6 @@ class ZCtx : public AsyncWrap { static void Reset(const FunctionCallbackInfo<Value> &args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - HandleScope scope(env->isolate()); ZCtx* ctx = Unwrap<ZCtx>(args.Holder()); |