Skip to content

Commit 3dda2d6

Browse files
Update HttpResponseWrapper.h
1 parent 5649f3d commit 3dda2d6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/HttpResponseWrapper.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct HttpResponseWrapper {
3636
template <int PROTOCOL>
3737
static inline constexpr decltype(auto) getHttpResponse(const FunctionCallbackInfo<Value> &args) {
3838
Isolate *isolate = args.GetIsolate();
39-
void *res = args.Holder()->GetAlignedPointerFromInternalField(0);
39+
void *res = args.This()->GetAlignedPointerFromInternalField(0);
4040
if (!res) {
4141
args.GetReturnValue().Set(isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8(isolate, "uWS.HttpResponse must not be accessed after uWS.HttpResponse.onAborted callback, or after a successful response. See documentation for uWS.HttpResponse and consult the user manual.", NewStringType::kNormal).ToLocalChecked())));
4242
}
@@ -53,7 +53,7 @@ struct HttpResponseWrapper {
5353

5454
/* Marks this JS object invalid */
5555
static inline void invalidateResObject(const FunctionCallbackInfo<Value> &args) {
56-
args.Holder()->SetAlignedPointerInInternalField(0, nullptr);
56+
args.This()->SetAlignedPointerInInternalField(0, nullptr);
5757
}
5858

5959
/* Takes nothing, returns this */
@@ -62,7 +62,7 @@ struct HttpResponseWrapper {
6262
auto *res = getHttpResponse<SSL>(args);
6363
if (res) {
6464
res->pause();
65-
args.GetReturnValue().Set(args.Holder());
65+
args.GetReturnValue().Set(args.This());
6666
}
6767
}
6868

@@ -72,7 +72,7 @@ struct HttpResponseWrapper {
7272
auto *res = getHttpResponse<SSL>(args);
7373
if (res) {
7474
res->resume();
75-
args.GetReturnValue().Set(args.Holder());
75+
args.GetReturnValue().Set(args.This());
7676
}
7777
}
7878

@@ -83,7 +83,7 @@ struct HttpResponseWrapper {
8383
if (res) {
8484
invalidateResObject(args);
8585
res->close();
86-
args.GetReturnValue().Set(args.Holder());
86+
args.GetReturnValue().Set(args.This());
8787
}
8888
}
8989

@@ -107,7 +107,7 @@ struct HttpResponseWrapper {
107107
dataArrayBuffer->Detach();
108108
});
109109

110-
args.GetReturnValue().Set(args.Holder());
110+
args.GetReturnValue().Set(args.This());
111111
}
112112
}
113113

@@ -121,7 +121,7 @@ struct HttpResponseWrapper {
121121
UniquePersistent<Function> p(isolate, Local<Function>::Cast(args[0]));
122122

123123
/* This is how we capture res (C++ this in invocation of this function) */
124-
UniquePersistent<Object> resObject(isolate, args.Holder());
124+
UniquePersistent<Object> resObject(isolate, args.This());
125125

126126
res->onAborted([p = std::move(p), resObject = std::move(resObject), isolate]() {
127127
HandleScope hs(isolate);
@@ -132,7 +132,7 @@ struct HttpResponseWrapper {
132132
CallJS(isolate, Local<Function>::New(isolate, p), 0, nullptr);
133133
});
134134

135-
args.GetReturnValue().Set(args.Holder());
135+
args.GetReturnValue().Set(args.This());
136136
}
137137
}
138138

@@ -232,7 +232,7 @@ struct HttpResponseWrapper {
232232
/* How important is this return? */
233233
});
234234

235-
args.GetReturnValue().Set(args.Holder());
235+
args.GetReturnValue().Set(args.This());
236236
}
237237
}
238238

@@ -249,7 +249,7 @@ struct HttpResponseWrapper {
249249
assumeCorked();
250250
res->writeStatus(data.getString());
251251

252-
args.GetReturnValue().Set(args.Holder());
252+
args.GetReturnValue().Set(args.This());
253253
}
254254
}
255255

@@ -272,7 +272,7 @@ struct HttpResponseWrapper {
272272
assumeCorked();
273273
res->endWithoutBody(reportedContentLength, closeConnection);
274274

275-
args.GetReturnValue().Set(args.Holder());
275+
args.GetReturnValue().Set(args.This());
276276
}
277277
}
278278

@@ -296,7 +296,7 @@ struct HttpResponseWrapper {
296296
assumeCorked();
297297
res->end(data.getString(), closeConnection);
298298

299-
args.GetReturnValue().Set(args.Holder());
299+
args.GetReturnValue().Set(args.This());
300300
}
301301
}
302302

@@ -367,7 +367,7 @@ struct HttpResponseWrapper {
367367
assumeCorked();
368368
res->writeHeader(header.getString(), value.getString());
369369

370-
args.GetReturnValue().Set(args.Holder());
370+
args.GetReturnValue().Set(args.This());
371371
}
372372
}
373373

@@ -385,7 +385,7 @@ struct HttpResponseWrapper {
385385
insideCorkCallback--;
386386
});
387387

388-
args.GetReturnValue().Set(args.Holder());
388+
args.GetReturnValue().Set(args.This());
389389
}
390390
}
391391

0 commit comments

Comments
 (0)