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