| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,10 @@ const { | |||
| 47 | 47 | }, | |
| 48 | 48 | } = internalBinding('constants'); | |
| 49 | 49 | ||
| 50 | + const { | ||
| 51 | + kEmptyObject, | ||
| 52 | + } = require('internal/util'); | ||
| 53 | + | ||
| 50 | 54 | const { | |
| 51 | 55 | validateInteger, | |
| 52 | 56 | } = require('internal/validators'); | |
@@ -93,7 +97,7 @@ function SecureContext(secureProtocol, secureOptions, minVersion, maxVersion) { | |||
| 93 | 97 | } | |
| 94 | 98 | ||
| 95 | 99 | function createSecureContext(options) { | |
| 96 | - if (!options) options = {}; | ||
| 100 | + if (!options) options = kEmptyObject; | ||
| 97 | 101 | ||
| 98 | 102 | const { | |
| 99 | 103 | honorCipherOrder, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,8 @@ const { | |||
| 40 | 40 | ||
| 41 | 41 | const { | |
| 42 | 42 | assertCrypto, | |
| 43 | - deprecate | ||
| 43 | + deprecate, | ||
| 44 | + kEmptyObject, | ||
| 44 | 45 | } = require('internal/util'); | |
| 45 | 46 | ||
| 46 | 47 | assertCrypto(); | |
@@ -1182,9 +1183,9 @@ function Server(options, listener) { | |||
| 1182 | 1183 | ||
| 1183 | 1184 | if (typeof options === 'function') { | |
| 1184 | 1185 | listener = options; | |
| 1185 | - options = {}; | ||
| 1186 | + options = kEmptyObject; | ||
| 1186 | 1187 | } else if (options == null || typeof options === 'object') { | |
| 1187 | - options = options || {}; | ||
| 1188 | + options = options ?? kEmptyObject; | ||
| 1188 | 1189 | } else { | |
| 1189 | 1190 | throw new ERR_INVALID_ARG_TYPE('options', 'Object', options); | |
| 1190 | 1191 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,10 @@ const { | |||
| 17 | 17 | }, | |
| 18 | 18 | } = require('internal/errors'); | |
| 19 | 19 | ||
| 20 | + const { | ||
| 21 | + kEmptyObject, | ||
| 22 | + } = require('internal/util'); | ||
| 23 | + | ||
| 20 | 24 | const { | |
| 21 | 25 | isArrayBufferView, | |
| 22 | 26 | } = require('internal/util/types'); | |
@@ -117,7 +121,7 @@ function processCiphers(ciphers, name) { | |||
| 117 | 121 | return { cipherList, cipherSuites }; | |
| 118 | 122 | } | |
| 119 | 123 | ||
| 120 | - function configSecureContext(context, options = {}, name = 'options') { | ||
| 124 | + function configSecureContext(context, options = kEmptyObject, name = 'options') { | ||
| 121 | 125 | validateObject(options, name); | |
| 122 | 126 | ||
| 123 | 127 | const { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const EventEmitter = require('events'); | |
| 4 | + const { kEmptyObject } = require('internal/util'); | ||
| 4 | 5 | const { Duplex } = require('stream'); | |
| 5 | 6 | const _tls_wrap = require('_tls_wrap'); | |
| 6 | 7 | const _tls_common = require('_tls_common'); | |
@@ -57,7 +58,7 @@ class SecurePair extends EventEmitter { | |||
| 57 | 58 | isServer = false, | |
| 58 | 59 | requestCert = !isServer, | |
| 59 | 60 | rejectUnauthorized = false, | |
| 60 | - options = {}) { | ||
| 61 | + options = kEmptyObject) { | ||
| 61 | 62 | super(); | |
| 62 | 63 | const { socket1, socket2 } = new DuplexPair(); | |
| 63 | 64 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments