@@ -142,6 +142,7 @@ class ZCtx : public AsyncWrap { |
142 | 142 | Bytef *in; |
143 | 143 | Bytef *out; |
144 | 144 | size_t in_off, in_len, out_off, out_len; |
| 145 | + Environment* env = ctx->env(); |
145 | 146 |
|
146 | 147 | if (args[1]->IsNull()) { |
147 | 148 | // just a flush |
@@ -152,7 +153,7 @@ class ZCtx : public AsyncWrap { |
152 | 153 | } else { |
153 | 154 | CHECK(Buffer::HasInstance(args[1])); |
154 | 155 | Local<Object> in_buf; |
155 | | - in_buf = args[1]->ToObject(args.GetIsolate()); |
| 156 | + in_buf = args[1]->ToObject(env->isolate()); |
156 | 157 | in_off = args[2]->Uint32Value(); |
157 | 158 | in_len = args[3]->Uint32Value(); |
158 | 159 |
|
@@ -161,7 +162,7 @@ class ZCtx : public AsyncWrap { |
161 | 162 | } |
162 | 163 |
|
163 | 164 | CHECK(Buffer::HasInstance(args[4])); |
164 | | - Local<Object> out_buf = args[4]->ToObject(args.GetIsolate()); |
| 165 | + Local<Object> out_buf = args[4]->ToObject(env->isolate()); |
165 | 166 | out_off = args[5]->Uint32Value(); |
166 | 167 | out_len = args[6]->Uint32Value(); |
167 | 168 | CHECK(Buffer::IsWithinBounds(out_off, out_len, Buffer::Length(out_buf))); |
@@ -199,7 +200,7 @@ class ZCtx : public AsyncWrap { |
199 | 200 |
|
200 | 201 |
|
201 | 202 | static void AfterSync(ZCtx* ctx, const FunctionCallbackInfo<Value>& args) { |
202 | | - Environment* env = Environment::GetCurrent(args); |
| 203 | + Environment* env = ctx->env(); |
203 | 204 | Local<Integer> avail_out = Integer::New(env->isolate(), |
204 | 205 | ctx->strm_.avail_out); |
205 | 206 | Local<Integer> avail_in = Integer::New(env->isolate(), |
|