Browse Source

src: remove unused Environment::GetCurrent() calls

Remove a few Environment::GetCurrent() calls that g++ failed to detect
were not used for anything.  The return value was assigned to a local
variable but not used meaningfully.

PR-URL: https://github.com/node-forward/node/pull/18
Reviewed-By: Fedor Indutny <fedor@indutny.com>
archived-io.js-v0.12
Ben Noordhuis 10 years ago
committed by Fedor Indutny
parent
commit
b45d33617b
  1. 2
      src/cares_wrap.cc
  2. 3
      src/node.cc
  3. 9
      src/node_zlib.cc

2
src/cares_wrap.cc

@ -989,8 +989,6 @@ void AfterGetNameInfo(uv_getnameinfo_t* req,
static void IsIP(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
node::Utf8Value ip(args[0]);
char address_buffer[sizeof(struct in6_addr)];

3
src/node.cc

@ -2828,11 +2828,8 @@ static void SignalExit(int signo) {
// when debugging the stream.Writable class or the process.nextTick
// function, it is useful to bypass JavaScript entirely.
static void RawDebug(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
CHECK(args.Length() == 1 && args[0]->IsString() &&
"must be called with a single string");
node::Utf8Value message(args[0]);
fprintf(stderr, "%s\n", *message);
fflush(stderr);

9
src/node_zlib.cc

@ -381,8 +381,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());
CHECK((args.Length() == 4 || args.Length() == 5) &&
"init(windowBits, level, memLevel, strategy, [dictionary])");
@ -421,20 +419,13 @@ class ZCtx : public AsyncWrap {
}
static void Params(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
CHECK(args.Length() == 2 && "params(level, strategy)");
ZCtx* ctx = Unwrap<ZCtx>(args.Holder());
Params(ctx, args[0]->Int32Value(), args[1]->Int32Value());
}
static void Reset(const FunctionCallbackInfo<Value> &args) {
Environment* env = Environment::GetCurrent(args.GetIsolate());
ZCtx* ctx = Unwrap<ZCtx>(args.Holder());
Reset(ctx);
SetDictionary(ctx);
}

Loading…
Cancel
Save