diff options
author | Michaël Zasso <targos@protonmail.com> | 2019-04-05 11:11:26 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-04-08 11:23:09 +0200 |
commit | 112cc7c27551254aa2b17098fb774867f05ed0d9 (patch) | |
tree | 0f48ef3ac9e8949f0bf49af38fb6dc7c6e2f64af /lib/_http_outgoing.js | |
parent | 969bd1eb7b56fda3573ad3d41745a491f2b06dde (diff) | |
download | android-node-v8-112cc7c27551254aa2b17098fb774867f05ed0d9.tar.gz android-node-v8-112cc7c27551254aa2b17098fb774867f05ed0d9.tar.bz2 android-node-v8-112cc7c27551254aa2b17098fb774867f05ed0d9.zip |
lib: use safe methods from primordials
This changes the primordials to expose built-in prototypes with their
methods already uncurried.
The uncurryThis function is therefore moved to the primordials.
All uses of uncurryThis on built-ins are changed to import the relevant
prototypes from primordials.
All uses of Function.call.bind are also changed to use primordials.
PR-URL: https://github.com/nodejs/node/pull/27096
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/_http_outgoing.js')
-rw-r--r-- | lib/_http_outgoing.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 34b064a6a3..2c2346d211 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -21,6 +21,8 @@ 'use strict'; +const { ObjectPrototype } = primordials; + const assert = require('internal/assert'); const Stream = require('stream'); const internalUtil = require('internal/util'); @@ -53,8 +55,6 @@ const { CRLF, debug } = common; const kIsCorked = Symbol('isCorked'); -const hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); - const RE_CONN_CLOSE = /(?:^|\W)close(?:$|\W)/i; const RE_TE_CHUNKED = common.chunkExpression; @@ -310,7 +310,7 @@ function _storeHeader(firstLine, headers) { } } else { for (const key in headers) { - if (hasOwnProperty(headers, key)) { + if (ObjectPrototype.hasOwnProperty(headers, key)) { processHeader(this, state, key, headers[key], true); } } |