Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const {
ObjectHasOwn,
ObjectKeys,
Proxy,
ReflectApply,
ReflectGetPrototypeOf,
Symbol,
} = primordials;
Expand Down Expand Up @@ -846,7 +845,7 @@ class Http2ServerResponse extends Stream {
this.writeHead(this[kState].statusCode);

if (this[kState].closed || stream.destroyed)
ReflectApply(onStreamCloseResponse, stream, []);
onStreamCloseResponse.call(stream);
else
stream.end();

Expand Down
13 changes: 6 additions & 7 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1960,7 +1960,7 @@ function shutdownWritable(callback) {
req.handle = handle;
const err = handle.shutdown(req);
if (err === 1) // synchronous finish
return ReflectApply(afterShutdown, req, [0]);
return afterShutdown.call(req, 0);
}

function finishSendTrailers(stream, headersList) {
Expand Down Expand Up @@ -2327,7 +2327,7 @@ class Http2Stream extends Duplex {
return;
}
debugStreamObj(this, 'shutting down writable on _final');
ReflectApply(shutdownWritable, this, [cb]);
shutdownWritable.call(this, cb);

if (this.session[kType] === NGHTTP2_SESSION_CLIENT && onClientStreamBodySentChannel.hasSubscribers) {
onClientStreamBodySentChannel.publish({ stream: this });
Expand Down Expand Up @@ -2741,8 +2741,7 @@ function doSendFD(session, options, fd, headers, streamOptions, err, stat) {
// response is canceled. The user code may also send a separate type
// of response so check again for the HEADERS_SENT flag
if ((typeof options.statCheck === 'function' &&
ReflectApply(options.statCheck, this,
[stat, headers, statOptions]) === false) ||
options.statCheck.call(this, stat, headers, statOptions) === false) ||
(this[kState].flags & STREAM_FLAGS_HEADERS_SENT)) {
return;
}
Expand Down Expand Up @@ -2801,7 +2800,7 @@ function doSendFileFD(session, options, fd, headers, streamOptions, err, stat) {
// response is canceled. The user code may also send a separate type
// of response so check again for the HEADERS_SENT flag
if ((typeof options.statCheck === 'function' &&
ReflectApply(options.statCheck, this, [stat, headers]) === false) ||
options.statCheck.call(this, stat, headers) === false) ||
(this[kState].flags & STREAM_FLAGS_HEADERS_SENT)) {
tryClose(fd);
return;
Expand Down Expand Up @@ -3633,9 +3632,9 @@ function getUnpackedSettings(buf, options = kEmptyObject) {
const settings = {};
let offset = 0;
while (offset < buf.length) {
const id = ReflectApply(readUInt16BE, buf, [offset]);
const id = readUInt16BE.call(buf, offset);
offset += 2;
const value = ReflectApply(readUInt32BE, buf, [offset]);
const value = readUInt32BE.call(buf, offset);
switch (id) {
case NGHTTP2_SETTINGS_HEADER_TABLE_SIZE:
settings.headerTableSize = value;
Expand Down
25 changes: 12 additions & 13 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const {
ObjectFreeze,
ObjectKeys,
ObjectSetPrototypeOf,
ReflectApply,
Symbol,
Uint32Array,
} = primordials;
Expand Down Expand Up @@ -255,7 +254,7 @@ function ZlibBase(opts, mode, handle, { flush, finishFlush, fullFlush }) {
}
}

ReflectApply(Transform, this, [{ autoDestroy: true, ...opts }]);
Transform.call(this, { autoDestroy: true, ...opts });
this[kError] = null;
this.bytesWritten = 0;
this._handle = handle;
Expand Down Expand Up @@ -681,7 +680,7 @@ function Zlib(opts, mode) {
processCallback,
dictionary);

ReflectApply(ZlibBase, this, [opts, mode, handle, zlibDefaultOpts]);
ZlibBase.call(this, opts, mode, handle, zlibDefaultOpts);

this._level = level;
this._strategy = strategy;
Expand Down Expand Up @@ -724,7 +723,7 @@ function Deflate(opts) {
if (!(this instanceof Deflate)) {
return deprecateInstantiation(Deflate, 'DEP0184', opts);
}
ReflectApply(Zlib, this, [opts, DEFLATE]);
Zlib.call(this, opts, DEFLATE);
}
ObjectSetPrototypeOf(Deflate.prototype, Zlib.prototype);
ObjectSetPrototypeOf(Deflate, Zlib);
Expand All @@ -733,7 +732,7 @@ function Inflate(opts) {
if (!(this instanceof Inflate)) {
return deprecateInstantiation(Inflate, 'DEP0184', opts);
}
ReflectApply(Zlib, this, [opts, INFLATE]);
Zlib.call(this, opts, INFLATE);
}
ObjectSetPrototypeOf(Inflate.prototype, Zlib.prototype);
ObjectSetPrototypeOf(Inflate, Zlib);
Expand All @@ -742,7 +741,7 @@ function Gzip(opts) {
if (!(this instanceof Gzip)) {
return deprecateInstantiation(Gzip, 'DEP0184', opts);
}
ReflectApply(Zlib, this, [opts, GZIP]);
Zlib.call(this, opts, GZIP);
}
ObjectSetPrototypeOf(Gzip.prototype, Zlib.prototype);
ObjectSetPrototypeOf(Gzip, Zlib);
Expand All @@ -751,7 +750,7 @@ function Gunzip(opts) {
if (!(this instanceof Gunzip)) {
return deprecateInstantiation(Gunzip, 'DEP0184', opts);
}
ReflectApply(Zlib, this, [opts, GUNZIP]);
Zlib.call(this, opts, GUNZIP);
}
ObjectSetPrototypeOf(Gunzip.prototype, Zlib.prototype);
ObjectSetPrototypeOf(Gunzip, Zlib);
Expand All @@ -761,7 +760,7 @@ function DeflateRaw(opts) {
if (!(this instanceof DeflateRaw)) {
return deprecateInstantiation(DeflateRaw, 'DEP0184', opts);
}
ReflectApply(Zlib, this, [opts, DEFLATERAW]);
Zlib.call(this, opts, DEFLATERAW);
}
ObjectSetPrototypeOf(DeflateRaw.prototype, Zlib.prototype);
ObjectSetPrototypeOf(DeflateRaw, Zlib);
Expand All @@ -770,7 +769,7 @@ function InflateRaw(opts) {
if (!(this instanceof InflateRaw)) {
return deprecateInstantiation(InflateRaw, 'DEP0184', opts);
}
ReflectApply(Zlib, this, [opts, INFLATERAW]);
Zlib.call(this, opts, INFLATERAW);
}
ObjectSetPrototypeOf(InflateRaw.prototype, Zlib.prototype);
ObjectSetPrototypeOf(InflateRaw, Zlib);
Expand All @@ -779,7 +778,7 @@ function Unzip(opts) {
if (!(this instanceof Unzip)) {
return deprecateInstantiation(Unzip, 'DEP0184', opts);
}
ReflectApply(Zlib, this, [opts, UNZIP]);
Zlib.call(this, opts, UNZIP);
}
ObjectSetPrototypeOf(Unzip.prototype, Zlib.prototype);
ObjectSetPrototypeOf(Unzip, Zlib);
Expand Down Expand Up @@ -837,7 +836,7 @@ function Brotli(opts, mode) {
this._writeState = new Uint32Array(2);
handle.init(brotliInitParamsArray, this._writeState, processCallback);

ReflectApply(ZlibBase, this, [opts, mode, handle, brotliDefaultOpts]);
ZlibBase.call(this, opts, mode, handle, brotliDefaultOpts);
}
ObjectSetPrototypeOf(Brotli.prototype, Zlib.prototype);
ObjectSetPrototypeOf(Brotli, Zlib);
Expand All @@ -846,7 +845,7 @@ function BrotliCompress(opts) {
if (!(this instanceof BrotliCompress)) {
return deprecateInstantiation(BrotliCompress, 'DEP0184', opts);
}
ReflectApply(Brotli, this, [opts, BROTLI_ENCODE]);
Brotli.call(this, opts, BROTLI_ENCODE);
}
ObjectSetPrototypeOf(BrotliCompress.prototype, Brotli.prototype);
ObjectSetPrototypeOf(BrotliCompress, Brotli);
Expand All @@ -855,7 +854,7 @@ function BrotliDecompress(opts) {
if (!(this instanceof BrotliDecompress)) {
return deprecateInstantiation(BrotliDecompress, 'DEP0184', opts);
}
ReflectApply(Brotli, this, [opts, BROTLI_DECODE]);
Brotli.call(this, opts, BROTLI_DECODE);
}
ObjectSetPrototypeOf(BrotliDecompress.prototype, Brotli.prototype);
ObjectSetPrototypeOf(BrotliDecompress, Brotli);
Expand Down
Loading