diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-18 03:15:57 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-20 13:52:44 +0100 |
commit | d4c91f28148af8a6c1a95392e5c88cb93d4b61c6 (patch) | |
tree | 482eb1a0470591925cb7a89c74f13b3b85717acb /lib/zlib.js | |
parent | 4b7a530f2b1a789b3feb64e3698d61b4ccc6bab5 (diff) | |
download | android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.tar.gz android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.tar.bz2 android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.zip |
lib: remove internal `util._extends()` usage
This removes all internal calls to the deprecated `_extends()`
function. It is slower than `Object.assign()` and the object spread
notation since V8 6.8 and using the spread notation often also
results in shorter code.
PR-URL: https://github.com/nodejs/node/pull/25105
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/zlib.js')
-rw-r--r-- | lib/zlib.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/zlib.js b/lib/zlib.js index a5d7ee82e3..51fb316b30 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -30,7 +30,6 @@ const { const Transform = require('_stream_transform'); const { deprecate, - _extend, types: { isAnyArrayBuffer, isArrayBufferView @@ -233,7 +232,7 @@ function ZlibBase(opts, mode, handle, { flush, finishFlush, fullFlush }) { Z_NO_FLUSH, Z_BLOCK, finishFlush); if (opts.encoding || opts.objectMode || opts.writableObjectMode) { - opts = _extend({}, opts); + opts = { ...opts }; opts.encoding = null; opts.objectMode = false; opts.writableObjectMode = false; |