Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 91cee73

Browse filesBrowse files
romanklrvagg
authored andcommitted
src: use ZCtxt as a source for v8::Isolates
Other methods like `After` already use ZCtxt as the source for Enviroment/ v8::Isolate objects, this commit applies the same style to the other missing methods (`After sync` and `Write`) PR-URL: #2547 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1 parent 993c22f commit 91cee73
Copy full SHA for 91cee73

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎src/node_zlib.cc‎

Copy file name to clipboardExpand all lines: src/node_zlib.cc
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class ZCtx : public AsyncWrap {
142142
Bytef *in;
143143
Bytef *out;
144144
size_t in_off, in_len, out_off, out_len;
145+
Environment* env = ctx->env();
145146

146147
if (args[1]->IsNull()) {
147148
// just a flush
@@ -152,7 +153,7 @@ class ZCtx : public AsyncWrap {
152153
} else {
153154
CHECK(Buffer::HasInstance(args[1]));
154155
Local<Object> in_buf;
155-
in_buf = args[1]->ToObject(args.GetIsolate());
156+
in_buf = args[1]->ToObject(env->isolate());
156157
in_off = args[2]->Uint32Value();
157158
in_len = args[3]->Uint32Value();
158159

@@ -161,7 +162,7 @@ class ZCtx : public AsyncWrap {
161162
}
162163

163164
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());
165166
out_off = args[5]->Uint32Value();
166167
out_len = args[6]->Uint32Value();
167168
CHECK(Buffer::IsWithinBounds(out_off, out_len, Buffer::Length(out_buf)));
@@ -199,7 +200,7 @@ class ZCtx : public AsyncWrap {
199200

200201

201202
static void AfterSync(ZCtx* ctx, const FunctionCallbackInfo<Value>& args) {
202-
Environment* env = Environment::GetCurrent(args);
203+
Environment* env = ctx->env();
203204
Local<Integer> avail_out = Integer::New(env->isolate(),
204205
ctx->strm_.avail_out);
205206
Local<Integer> avail_in = Integer::New(env->isolate(),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.