diff options
author | cjihrig <cjihrig@gmail.com> | 2015-01-28 20:05:53 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-01-31 23:47:29 -0500 |
commit | 6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40 (patch) | |
tree | 29a3b1ce92cfad3ae5d41a4ba7451846beace950 /lib/_tls_common.js | |
parent | bce7a2608eb198eee6ecd7991062efd6daeeb440 (diff) | |
download | android-node-v8-6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40.tar.gz android-node-v8-6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40.tar.bz2 android-node-v8-6ac8bdc0aba5f60f4b4f2da5abd36d664062aa40.zip |
lib: reduce util.is*() usage
Many of the util.is*() methods used to check data types
simply compare against a single value or the result of
typeof. This commit replaces calls to these methods with
equivalent checks. This commit does not touch calls to the
more complex methods (isRegExp(), isDate(), etc.).
Fixes: https://github.com/iojs/io.js/issues/607
PR-URL: https://github.com/iojs/io.js/pull/647
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/_tls_common.js')
-rw-r--r-- | lib/_tls_common.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 3db0d6969f..2c15d91df8 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -1,6 +1,5 @@ 'use strict'; -const util = require('util'); const constants = require('constants'); const tls = require('tls'); @@ -47,7 +46,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // NOTE: It's important to add CA before the cert to be able to load // cert's issuer in C++ code. if (options.ca) { - if (util.isArray(options.ca)) { + if (Array.isArray(options.ca)) { for (var i = 0, len = options.ca.length; i < len; i++) { c.context.addCACert(options.ca[i]); } @@ -95,7 +94,7 @@ exports.createSecureContext = function createSecureContext(options, context) { else c.context.setCiphers(tls.DEFAULT_CIPHERS); - if (util.isUndefined(options.ecdhCurve)) + if (options.ecdhCurve === undefined) c.context.setECDHCurve(tls.DEFAULT_ECDH_CURVE); else if (options.ecdhCurve) c.context.setECDHCurve(options.ecdhCurve); @@ -103,7 +102,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.dhparam) c.context.setDHParam(options.dhparam); if (options.crl) { - if (util.isArray(options.crl)) { + if (Array.isArray(options.crl)) { for (var i = 0, len = options.crl.length; i < len; i++) { c.context.addCRL(options.crl[i]); } |