diff --git a/.eslintrc b/.eslintrc
index 8d3689443bd1de..618b3d51116053 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -93,6 +93,7 @@ rules:
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}]
no-tabs: 2
no-trailing-spaces: 2
+ operator-linebreak: [2, after, {overrides: {'?': ignore, ':': ignore}}]
quotes: [2, single, avoid-escape]
semi: 2
semi-spacing: 2
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 6bf44097890794..7b004801207054 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -9,7 +9,7 @@ Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md
##### Checklist
-- [ ] `make -j8 test` (UNIX), or `vcbuild test nosign` (Windows) passes
+- [ ] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [ ] commit message follows commit guidelines
diff --git a/BUILDING.md b/BUILDING.md
index 5051da343353b3..b1962d53c2caf4 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -24,6 +24,15 @@ On OS X, you will also need:
this under the menu `Xcode -> Preferences -> Downloads`
* This step will install `gcc` and the related toolchain containing `make`
+* You may want to setup [firewall rules](tools/macosx-firewall.sh) to avoid
+popups asking to accept incoming network connections when running tests:
+
+```console
+$ sudo ./tools/macosx-firewall.sh
+```
+Running this script will add rules for the executable `node` in the out
+directory and the symbolic `node` link in the projects root directory.
+
On FreeBSD and OpenBSD, you may also need:
* libexecinfo
@@ -31,9 +40,17 @@ To build Node.js:
```console
$ ./configure
-$ make
+$ make -j4
```
+Running `make` with the `-j4` flag will cause it to run 4 compilation jobs
+concurrently which may significantly reduce build time. The number after `-j`
+can be changed to best suit the number of processor cores on your machine. If
+you run into problems running `make` with concurrency, try running it without
+the `-j4` flag. See the
+[GNU Make Documentation](https://www.gnu.org/software/make/manual/html_node/Parallel.html)
+for more information.
+
Note that the above requires that `python` resolve to Python 2.6 or 2.7 and not a newer version.
To run the tests:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5263390e5c07c..8d8f2d68e12005 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,7 +28,8 @@ release.
- 7.2.1
+ 7.3.0
+ 7.2.1 7.2.0 7.1.0 7.0.0
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md
index 702d539d460301..abf91289fcfdec 100644
--- a/COLLABORATOR_GUIDE.md
+++ b/COLLABORATOR_GUIDE.md
@@ -126,7 +126,7 @@ information regarding the change process:
- Protects against the assumption that GitHub will be around forever.
Review the commit message to ensure that it adheres to the guidelines
-outlined in the [contributing](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit) guide.
+outlined in the [contributing](./CONTRIBUTING.md#step-3-commit) guide.
See the commit log for examples such as
[this one](https://github.com/nodejs/node/commit/b636ba8186) if unsure
@@ -237,7 +237,8 @@ Save the file and close the editor. You'll be asked to enter a new
commit message for that commit. This is a good moment to fix incorrect
commit logs, ensure that they are properly formatted, and add
`Reviewed-By` lines.
-* The commit message text must conform to the [commit message guidelines](../CONTRIBUTING.md#step-3-commit).
+* The commit message text must conform to the
+[commit message guidelines](./CONTRIBUTING.md#step-3-commit).
Time to push it:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6f44949a31e0ca..830f2615528170 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -156,7 +156,7 @@ to see how they should be structured can also help.
To run the tests on Unix / OS X:
```text
-$ ./configure && make -j8 test
+$ ./configure && make -j4 test
```
Windows:
@@ -189,7 +189,7 @@ You can run tests directly with node:
$ ./node ./test/parallel/test-stream2-transform.js
```
-Remember to recompile with `make -j8` in between test runs if you change
+Remember to recompile with `make -j4` in between test runs if you change
core modules.
### Step 6: Push
diff --git a/Makefile b/Makefile
index 975efc96866009..d17930776f3d67 100644
--- a/Makefile
+++ b/Makefile
@@ -64,13 +64,18 @@ endif
# to check for changes.
.PHONY: $(NODE_EXE) $(NODE_G_EXE)
+# The -r/-L check stops it recreating the link if it is already in place,
+# otherwise $(NODE_EXE) being a .PHONY target means it is always re-run.
+# Without the check there is a race condition between the link being deleted
+# and recreated which can break the addons build when running test-ci
+# See comments on the build-addons target for some more info
$(NODE_EXE): config.gypi out/Makefile
$(MAKE) -C out BUILDTYPE=Release V=$(V)
- ln -fs out/Release/$(NODE_EXE) $@
+ if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
$(NODE_G_EXE): config.gypi out/Makefile
$(MAKE) -C out BUILDTYPE=Debug V=$(V)
- ln -fs out/Debug/$(NODE_EXE) $@
+ if [ ! -r $@ -o ! -L $@ ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \
diff --git a/README.md b/README.md
index 68ffbb90598d0f..bdb74b5446ac40 100644
--- a/README.md
+++ b/README.md
@@ -237,8 +237,8 @@ more information about the governance of the Node.js project, see
**Ilkka Myller** <ilkka.myller@nodefield.com>
* [isaacs](https://github.com/isaacs) -
**Isaac Z. Schlueter** <i@izs.me>
-* [italoacasas](https://github.com/italoacasas)
-**Italo A. Casas** <me@italoacasas.com>
+* [italoacasas](https://github.com/italoacasas) -
+**Italo A. Casas** <me@italoacasas.com>
* [iWuzHere](https://github.com/iWuzHere) -
**Imran Iqbal** <imran@imraniqbal.org>
* [JacksonTian](https://github.com/JacksonTian) -
diff --git a/benchmark/README.md b/benchmark/README.md
index a90f0f548fdab3..bbabcf4c4e9fde 100644
--- a/benchmark/README.md
+++ b/benchmark/README.md
@@ -50,6 +50,21 @@ install.packages("ggplot2")
install.packages("plyr")
```
+### CRAN Mirror Issues
+In the event you get a message that you need to select a CRAN mirror first.
+
+You can specify a mirror by adding in the repo parameter.
+
+If we used the "http://cran.us.r-project.org" mirror, it could look somehting like
+this:
+
+```R
+install.packages("ggplot2", repo="http://cran.us.r-project.org")
+```
+
+Of course, use the mirror that suits your location.
+A list of mirrors is [located here](https://cran.r-project.org/mirrors.html).
+
## Running benchmarks
### Running individual benchmarks
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index df187b8307a6f6..009a3b10425ee4 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 4
#define V8_BUILD_NUMBER 500
-#define V8_PATCH_LEVEL 44
+#define V8_PATCH_LEVEL 45
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/deps/v8/src/base/platform/time.cc b/deps/v8/src/base/platform/time.cc
index 76a820955fb98d..6b483382f02ea7 100644
--- a/deps/v8/src/base/platform/time.cc
+++ b/deps/v8/src/base/platform/time.cc
@@ -639,7 +639,7 @@ bool TimeTicks::IsHighResolutionClockWorking() {
bool ThreadTicks::IsSupported() {
#if (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \
- defined(V8_OS_MACOSX) || defined(V8_OS_ANDROID)
+ defined(V8_OS_MACOSX) || defined(V8_OS_ANDROID) || defined(V8_OS_SOLARIS)
return true;
#elif defined(V8_OS_WIN)
return IsSupportedWin();
@@ -655,6 +655,8 @@ ThreadTicks ThreadTicks::Now() {
#elif(defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \
defined(V8_OS_ANDROID)
return ThreadTicks(ClockNow(CLOCK_THREAD_CPUTIME_ID));
+#elif V8_OS_SOLARIS
+ return ThreadTicks(gethrvtime() / Time::kNanosecondsPerMicrosecond);
#elif V8_OS_WIN
return ThreadTicks::GetForThread(::GetCurrentThread());
#else
diff --git a/doc/api/buffer.md b/doc/api/buffer.md
index 2eef3512a0c22a..b9f8369335a0d6 100644
--- a/doc/api/buffer.md
+++ b/doc/api/buffer.md
@@ -282,7 +282,7 @@ const buf = Buffer.from([1, 2, 3]);
// 1
// 2
// 3
-for (var b of buf) {
+for (const b of buf) {
console.log(b);
}
```
@@ -392,9 +392,9 @@ deprecated: v6.0.0
* `size` {Integer} The desired length of the new `Buffer`
-Allocates a new `Buffer` of `size` bytes. The `size` must be less than or equal
-to the value of [`buffer.kMaxLength`]. Otherwise, a [`RangeError`] is thrown.
-A zero-length `Buffer` will be created if `size <= 0`.
+Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
+[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
+A zero-length `Buffer` will be created if `size` is 0.
Unlike [`ArrayBuffers`][`ArrayBuffer`], the underlying memory for `Buffer` instances
created in this way is *not initialized*. The contents of a newly created `Buffer`
@@ -404,14 +404,14 @@ are unknown and *could contain sensitive data*. Use
Example:
```js
-const buf = new Buffer(5);
+const buf = new Buffer(10);
-// Prints: (contents may vary):
+// Prints: (contents may vary):
console.log(buf);
buf.fill(0);
-// Prints:
+// Prints:
console.log(buf);
```
@@ -470,9 +470,9 @@ const buf = Buffer.alloc(5);
console.log(buf);
```
-The `size` must be less than or equal to the value of [`buffer.kMaxLength`].
-Otherwise, a [`RangeError`] is thrown. A zero-length `Buffer` will be created if
-`size <= 0`.
+Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
+[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
+A zero-length `Buffer` will be created if `size` is 0.
If `fill` is specified, the allocated `Buffer` will be initialized by calling
[`buf.fill(fill)`][`buf.fill()`].
@@ -511,9 +511,9 @@ added: v5.10.0
* `size` {Integer} The desired length of the new `Buffer`
-Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
-be less than or equal to the value of [`buffer.kMaxLength`]. Otherwise, a
-[`RangeError`] is thrown. A zero-length `Buffer` will be created if `size <= 0`.
+Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
+[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
+A zero-length `Buffer` will be created if `size` is 0.
The underlying memory for `Buffer` instances created in this way is *not
initialized*. The contents of the newly created `Buffer` are unknown and
@@ -523,14 +523,14 @@ initialized*. The contents of the newly created `Buffer` are unknown and
Example:
```js
-const buf = Buffer.allocUnsafe(5);
+const buf = Buffer.allocUnsafe(10);
-// Prints: (contents may vary):
+// Prints: (contents may vary):
console.log(buf);
buf.fill(0);
-// Prints:
+// Prints:
console.log(buf);
```
@@ -557,10 +557,9 @@ added: v5.10.0
* `size` {Integer} The desired length of the new `Buffer`
-Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
-`size` must be less than or equal to the value of [`buffer.kMaxLength`].
-Otherwise, a [`RangeError`] is thrown. A zero-length `Buffer` will be created if
-`size <= 0`.
+Allocates a new `Buffer` of `size` bytes. If the `size` is larger than
+[`buffer.kMaxLength`] or smaller than 0, a [`RangeError`] will be thrown.
+A zero-length `Buffer` will be created if `size` is 0.
The underlying memory for `Buffer` instances created in this way is *not
initialized*. The contents of the newly created `Buffer` are unknown and
@@ -995,7 +994,7 @@ overlapping region within the same `Buffer`
```js
const buf = Buffer.allocUnsafe(26);
-for (var i = 0 ; i < 26 ; i++) {
+for (let i = 0 ; i < 26 ; i++) {
// 97 is the decimal ASCII value for 'a'
buf[i] = i + 97;
}
@@ -1028,7 +1027,7 @@ const buf = Buffer.from('buffer');
// [3, 102]
// [4, 101]
// [5, 114]
-for (var pair of buf.entries()) {
+for (const pair of buf.entries()) {
console.log(pair);
}
```
@@ -1122,7 +1121,7 @@ Examples:
const buf = Buffer.from('this is a buffer');
// Prints: 0
-console.log(buf.indexOf('this')));
+console.log(buf.indexOf('this'));
// Prints: 2
console.log(buf.indexOf('is'));
@@ -1212,7 +1211,7 @@ const buf = Buffer.from('buffer');
// 3
// 4
// 5
-for (var key of buf.keys()) {
+for (const key of buf.keys()) {
console.log(key);
}
```
@@ -1223,8 +1222,8 @@ added: v6.0.0
-->
* `value` {String | Buffer | Integer} What to search for
-* `byteOffset` {Integer} Where to begin searching in `buf` (not inclusive).
- **Default:** [`buf.length`]
+* `byteOffset` {Integer} Where to begin searching in `buf`.
+ **Default:** [`buf.length`]` - 1`
* `encoding` {String} If `value` is a string, this is its encoding.
**Default:** `'utf8'`
* Returns: {Integer} The index of the last occurrence of `value` in `buf` or `-1`
@@ -1264,7 +1263,7 @@ console.log(buf.lastIndexOf('buffer', 4));
const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2');
// Prints: 6
-console.log(utf16Buffer.lastIndexOf('\u03a3', null, 'ucs2'));
+console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'ucs2'));
// Prints: 4
console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'ucs2'));
@@ -1302,7 +1301,7 @@ use [`buf.slice()`] to create a new `Buffer`.
Examples:
```js
-var buf = Buffer.allocUnsafe(10);
+let buf = Buffer.allocUnsafe(10);
buf.write('abcdefghj', 0, 'ascii');
@@ -1446,7 +1445,7 @@ const buf = Buffer.from([0, 5]);
console.log(buf.readInt16BE());
// Prints: 1280
-console.log(buf.readInt16LE(1));
+console.log(buf.readInt16LE());
// Throws an exception: RangeError: Index out of range
console.log(buf.readInt16LE(1));
@@ -1509,10 +1508,10 @@ Examples:
```js
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
-// Prints: 1234567890ab
+// Prints: -546f87a9cbee
console.log(buf.readIntLE(0, 6).toString(16));
-// Prints: -546f87a9cbee
+// Prints: 1234567890ab
console.log(buf.readIntBE(0, 6).toString(16));
// Throws an exception: RangeError: Index out of range
@@ -1673,7 +1672,7 @@ one byte from the original `Buffer`
```js
const buf1 = Buffer.allocUnsafe(26);
-for (var i = 0 ; i < 26 ; i++) {
+for (let i = 0 ; i < 26 ; i++) {
// 97 is the decimal ASCII value for 'a'
buf1[i] = i + 97;
}
@@ -1737,7 +1736,7 @@ console.log(buf1);
const buf2 = Buffer.from([0x1, 0x2, 0x3]);
// Throws an exception: RangeError: Buffer size must be a multiple of 16-bits
-buf2.swap32();
+buf2.swap16();
```
### buf.swap32()
@@ -1822,7 +1821,7 @@ Examples:
```js
const buf1 = Buffer.allocUnsafe(26);
-for (var i = 0 ; i < 26 ; i++) {
+for (let i = 0 ; i < 26 ; i++) {
// 97 is the decimal ASCII value for 'a'
buf1[i] = i + 97;
}
@@ -1897,7 +1896,7 @@ const buf = Buffer.from('buffer');
// 102
// 101
// 114
-for (var value of buf.values()) {
+for (const value of buf.values()) {
console.log(value);
}
@@ -1908,7 +1907,7 @@ for (var value of buf.values()) {
// 102
// 101
// 114
-for (var value of buf) {
+for (const value of buf) {
console.log(value);
}
```
@@ -2293,7 +2292,7 @@ Returns the maximum number of bytes that will be returned when
`buf.inspect()` is called. This can be overridden by user modules. See
[`util.inspect()`] for more details on `buf.inspect()` behavior.
-Note that this is a property on the `buffer` module as returned by
+Note that this is a property on the `buffer` module returned by
`require('buffer')`, not on the `Buffer` global or a `Buffer` instance.
## buffer.kMaxLength
@@ -2306,6 +2305,9 @@ added: v3.0.0
On 32-bit architectures, this value is `(2^30)-1` (~1GB).
On 64-bit architectures, this value is `(2^31)-1` (~2GB).
+Note that this is a property on the `buffer` module returned by
+`require('buffer')`, not on the `Buffer` global or a `Buffer` instance.
+
## buffer.transcode(source, fromEnc, toEnc)
+* Returns: {Worker} A reference to `worker`.
+
In a worker, this function will close all servers, wait for the `'close'` event on
those servers, and then disconnect the IPC channel.
diff --git a/doc/api/crypto.md b/doc/api/crypto.md
index ef9db7ffc65420..7f77d3f940768c 100644
--- a/doc/api/crypto.md
+++ b/doc/api/crypto.md
@@ -1082,26 +1082,15 @@ deprecated: v0.11.13
> Stability: 0 - Deprecated: Use [`tls.createSecureContext()`][] instead.
-The `crypto.createCredentials()` method is a deprecated alias for creating
-and returning a `tls.SecureContext` object. The `crypto.createCredentials()`
-method should not be used.
+- `details` {Object} Identical to [`tls.createSecureContext()`][].
-The optional `details` argument is a hash object with keys:
+The `crypto.createCredentials()` method is a deprecated function for creating
+and returning a `tls.SecureContext`. It should not be used. Replace it with
+[`tls.createSecureContext()`][] which has the exact same arguments and return
+value.
-* `pfx` : {String|Buffer} - PFX or PKCS12 encoded private
- key, certificate and CA certificates
-* `key` : {String} - PEM encoded private key
-* `passphrase` : {String} - passphrase for the private key or PFX
-* `cert` : {String} - PEM encoded certificate
-* `ca` : {String|Array} - Either a string or array of strings of PEM encoded CA
- certificates to trust.
-* `crl` : {String|Array} - Either a string or array of strings of PEM encoded CRLs
- (Certificate Revocation List)
-* `ciphers`: {String} using the [OpenSSL cipher list format][] describing the
- cipher algorithms to use or exclude.
-
-If no 'ca' details are given, Node.js will use Mozilla's default
-[publicly trusted list of CAs][].
+Returns a `tls.SecureContext`, as-if [`tls.createSecureContext()`][] had been
+called.
### crypto.createDecipher(algorithm, password)
-* `options` {Object}
- * `host` {string} Host the client should connect to.
- * `port` {number} Port the client should connect to.
- * `socket` {net.Socket} Establish secure connection on a given socket rather
- than creating a new socket. If this option is specified, `host` and `port`
- are ignored.
- * `path` {string} Creates unix socket connection to path. If this option is
- specified, `host` and `port` are ignored.
- * `pfx` {string|Buffer} A string or `Buffer` containing the private key,
- certificate, and CA certs of the client in PFX or PKCS12 format.
- * `key` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of
- strings, or array of `Buffer`s containing the private key of the client in
- PEM format.
- * `passphrase` {string} A string containing the passphrase for the private key
- or pfx.
- * `cert` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of
- strings, or array of `Buffer`s containing the certificate key of the client
- in PEM format.
- * `ca` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings,
- or array of `Buffer`s of trusted certificates in PEM format. If this is
- omitted several well known "root" CAs (like VeriSign) will be used. These
- are used to authorize connections.
- * `ciphers` {string} A string describing the ciphers to use or exclude,
- separated by `:`. Uses the same default cipher suite as
- [`tls.createServer()`][].
- * `rejectUnauthorized` {boolean} If `true`, the server certificate is verified
- against the list of supplied CAs. An `'error'` event is emitted if
- verification fails; `err.code` contains the OpenSSL error code. Defaults to
- `true`.
- * `NPNProtocols` {string[]|Buffer[]} An array of strings or `Buffer`s
- containing supported NPN protocols. `Buffer`s should have the format
- `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first
- byte is the length of the next protocol name. Passing an array is usually
- much simpler, e.g. `['hello', 'world']`.
- * `ALPNProtocols`: {string[]|Buffer[]} An array of strings or `Buffer`s
- containing the supported ALPN protocols. `Buffer`s should have the format
- `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte
- is the length of the next protocol name. Passing an array is usually much
- simpler: `['hello', 'world']`.)
- * `servername`: {string} Server name for the SNI (Server Name Indication) TLS
- extension.
- * `checkServerIdentity(servername, cert)` {Function} A callback function
- to be used when checking the server's hostname against the certificate.
- This should throw an error if verification fails. The method should return
- `undefined` if the `servername` and `cert` are verified.
- * `secureProtocol` {string} The SSL method to use, e.g. `SSLv3_method` to
- force SSL version 3. The possible values depend on the version of OpenSSL
- installed in the environment and are defined in the constant
- [SSL_METHODS][].
- * `secureContext` {object} An optional TLS context object as returned by from
- `tls.createSecureContext( ... )`. It can be used for caching client
- certificates, keys, and CA certificates.
- * `session` {Buffer} A `Buffer` instance, containing TLS session.
- * `minDHSize` {number} Minimum size of the DH parameter in bits to accept a
- TLS connection. When a server offers a DH parameter with a size less
- than `minDHSize`, the TLS connection is destroyed and an error is thrown.
- Defaults to `1024`.
-* `callback` {Function}
+* `port` {number} Default value for `options.port`.
+* `host` {string} Optional default value for `options.host`.
+* `options` {Object} See [`tls.connect()`][].
+* `callback` {Function} See [`tls.connect()`][].
-Creates a new client connection to the given `options.port` and `options.host`
-If `options.host` is omitted, it defaults to `localhost`.
+Same as [`tls.connect()`][] except that `port` and `host` can be provided
+as arguments instead of options.
-The `callback` function, if specified, will be added as a listener for the
-[`'secureConnect'`][] event.
+*Note*: A port or host option, if specified, will take precedence over any port
+or host argument.
-`tls.connect()` returns a [`tls.TLSSocket`][] object.
+## tls.connect(path[, options][, callback])
+
-## tls.connect(port[, host][, options][, callback])
+* `path` {string} Default value for `options.path`.
+* `options` {Object} See [`tls.connect()`][].
+* `callback` {Function} See [`tls.connect()`][].
+
+Same as [`tls.connect()`][] except that `path` can be provided
+as an argument instead of an option.
+
+*Note*: A path option, if specified, will take precedence over the path
+argument.
+
+## tls.connect(options[, callback])
-* `port` {number}
-* `host` {string}
* `options` {Object}
- * `host` {string} Host the client should connect to.
+ * `host` {string} Host the client should connect to, defaults to 'localhost'.
* `port` {number} Port the client should connect to.
- * `socket` {net.Socket} Establish secure connection on a given socket rather
- than creating a new socket. If this option is specified, `host` and `port`
- are ignored.
* `path` {string} Creates unix socket connection to path. If this option is
specified, `host` and `port` are ignored.
- * `pfx` {string|Buffer} A string or `Buffer` containing the private key,
- certificate, and CA certs of the client in PFX or PKCS12 format.
- * `key` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of
- strings, or array of `Buffer`s containing the private key of the client in
- PEM format.
- * `passphrase` {string} A string containing the passphrase for the private key
- or pfx.
- * `cert` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of
- strings, or array of `Buffer`s containing the certificate key of the client
- in PEM format.
- * `ca` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings,
- or array of `Buffer`s of trusted certificates in PEM format. If this is
- omitted several well known "root" CAs (like VeriSign) will be used. These
- are used to authorize connections.
- * `ciphers` {string} A string describing the ciphers to use or exclude,
- separated by `:`. Uses the same default cipher suite as
- [`tls.createServer()`][].
+ * `socket` {net.Socket} Establish secure connection on a given socket rather
+ than creating a new socket. If this option is specified, `path`, `host` and
+ `port` are ignored. Usually, a socket is already connected when passed to
+ `tls.connect()`, but it can be connected later. Note that
+ connection/disconnection/destruction of `socket` is the user's
+ responsibility, calling `tls.connect()` will not cause `net.connect()` to be
+ called.
* `rejectUnauthorized` {boolean} If `true`, the server certificate is verified
against the list of supplied CAs. An `'error'` event is emitted if
verification fails; `err.code` contains the OpenSSL error code. Defaults to
@@ -833,24 +806,21 @@ added: v0.11.3
to be used when checking the server's hostname against the certificate.
This should throw an error if verification fails. The method should return
`undefined` if the `servername` and `cert` are verified.
- * `secureProtocol` {string} The SSL method to use, e.g. `SSLv3_method` to
- force SSL version 3. The possible values depend on the version of OpenSSL
- installed in the environment and are defined in the constant
- [SSL_METHODS][].
- * `secureContext` {object} An optional TLS context object as returned by from
- `tls.createSecureContext( ... )`. It can be used for caching client
- certificates, keys, and CA certificates.
* `session` {Buffer} A `Buffer` instance, containing TLS session.
* `minDHSize` {number} Minimum size of the DH parameter in bits to accept a
TLS connection. When a server offers a DH parameter with a size less
than `minDHSize`, the TLS connection is destroyed and an error is thrown.
Defaults to `1024`.
+ * `secureContext`: Optional TLS context object created with
+ [`tls.createSecureContext()`][]. If a `secureContext` is _not_ provided, one
+ will be created by passing the entire `options` object to
+ `tls.createSecureContext()`. *Note*: In effect, all
+ [`tls.createSecureContext()`][] options can be provided, but they will be
+ _completely ignored_ unless the `secureContext` option is missing.
+ * ...: Optional [`tls.createSecureContext()`][] options can be provided, see
+ the `secureContext` option for more information.
* `callback` {Function}
-Creates a new client connection to the given `port` and `host` or
-`options.port` and `options.host`. (If `host` is omitted, it defaults to
-`localhost`.)
-
The `callback` function, if specified, will be added as a listener for the
[`'secureConnect'`][] event.
@@ -918,81 +888,88 @@ added: v0.11.13
-->
* `options` {Object}
- * `pfx` {string|Buffer} A string or `Buffer` holding the PFX or PKCS12 encoded
- private key, certificate, and CA certificates.
- * `key` {string|string[]|Buffer|Object[]} The private key of the server in
- PEM format. To support multiple keys using different algorithms, an array
- can be provided either as an array of key strings or as an array of objects
- in the format `{pem: key, passphrase: passphrase}`. This option is
- *required* for ciphers that make use of private keys.
- * `passphrase` {string} A string containing the passphrase for the private key
- or pfx.
- * `cert` {string} A string containing the PEM encoded certificate
- * `ca`{string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings,
- or array of `Buffer`s of trusted certificates in PEM format. If omitted,
- several well known "root" CAs (like VeriSign) will be used. These are used
- to authorize connections.
- * `crl` {string|string[]} Either a string or array of strings of PEM encoded
- CRLs (Certificate Revocation List).
- * `ciphers` {string} A string describing the ciphers to use or exclude.
- Consult
-
- for details on the format.
- * `honorCipherOrder` {boolean} If `true`, when a cipher is being selected,
- the server's preferences will be used instead of the client preferences.
+ * `pfx` {string|Buffer} Optional PFX or PKCS12 encoded private key and
+ certificate chain. `pfx` is an alternative to providing `key` and `cert`
+ individually. PFX is usually encrypted, if it is, `passphrase` will be used
+ to decrypt it.
+ * `key` {string|string[]|Buffer|Buffer[]|Object[]} Optional private keys in
+ PEM format. PEM allows the option of private keys being encrypted. Encrypted
+ keys will be decrypted with `options.passphrase`. Multiple keys using
+ different algorithms can be provided either as an array of unencrypted key
+ strings or buffers, or an array of objects in the form `{pem:
+ [, passphrase: ]}`. The object form can only occur in
+ an array. `object.passphrase` is optional. Encrypted keys will be decrypted
+ with `object.passphrase` if provided, or `options.passphrase` if it is not.
+ * `passphrase` {string} Optional shared passphrase used for a single private
+ key and/or a PFX.
+ * `cert` {string|string[]|Buffer|Buffer[]} Optional cert chains in PEM format.
+ One cert chain should be provided per private key. Each cert chain should
+ consist of the PEM formatted certificate for a provided private `key`,
+ followed by the PEM formatted intermediate certificates (if any), in order,
+ and not including the root CA (the root CA must be pre-known to the peer,
+ see `ca`). When providing multiple cert chains, they do not have to be in
+ the same order as their private keys in `key`. If the intermediate
+ certificates are not provided, the peer will not be able to validate the
+ certificate, and the handshake will fail.
+ * `ca`{string|string[]|Buffer|Buffer[]} Optional CA certificates to trust.
+ Default is the well-known CAs from Mozilla. When connecting to peers that
+ use certificates issued privately, or self-signed, the private root CA or
+ self-signed certificate must be provided to verify the peer.
+ * `crl` {string|string[]|Buffer|Buffer[]} Optional PEM formatted
+ CRLs (Certificate Revocation Lists).
+ * `ciphers` {string} Optional cipher suite specification, replacing the
+ default. For more information, see [modifying the default cipher suite][].
+ * `honorCipherOrder` {boolean} Attempt to use the server's cipher suite
+ preferences instead of the client's. When `true`, causes
+ `SSL_OP_CIPHER_SERVER_PREFERENCE` to be set in `secureOptions`, see
+ [OpenSSL Options][] for more information.
+ *Note*: [`tls.createServer()`][] sets the default value to `true`, other
+ APIs that create secure contexts leave it unset.
+ * `ecdhCurve` {string} A string describing a named curve to use for ECDH key
+ agreement or `false` to disable ECDH. Defaults to `prime256v1` (NIST P-256).
+ Use [`crypto.getCurves()`][] to obtain a list of available curve names. On
+ recent releases, `openssl ecparam -list_curves` will also display the name
+ and description of each available elliptic curve.
+ * `dhparam` {string|Buffer} Diffie Hellman parameters, required for
+ [Perfect Forward Secrecy][]. Use `openssl dhparam` to create the parameters.
+ The key length must be greater than or equal to 1024 bits, otherwise an
+ error will be thrown. It is strongly recommended to use 2048 bits or larger
+ for stronger security. If omitted or invalid, the parameters are silently
+ discarded and DHE ciphers will not be available.
+ * `secureProtocol` {string} Optional SSL method to use, default is
+ `"SSLv23_method"`. The possible values are listed as [SSL_METHODS][], use
+ the function names as strings. For example, `"SSLv3_method"` to force SSL
+ version 3.
+ * `secureOptions` {number} Optionally affect the OpenSSL protocol behaviour,
+ which is not usually necessary. This should be used carefully if at all!
+ Value is a numeric bitmask of the `SSL_OP_*` options from
+ [OpenSSL Options][].
+ * `sessionIdContext` {string} Optional opaque identifier used by servers to
+ ensure session state is not shared between applications. Unused by clients.
+ *Note*: [`tls.createServer()`][] uses a 128 bit truncated SHA1 hash value
+ generated from `process.argv`, other APIs that create secure contexts
+ have no default value.
The `tls.createSecureContext()` method creates a credentials object.
+A key is *required* for ciphers that make use of certificates. Either `key` or
+`pfx` can be used to provide it.
+
If the 'ca' option is not given, then Node.js will use the default
publicly trusted list of CAs as given in
.
-## tls.createServer(options[, secureConnectionListener])
+## tls.createServer([options][, secureConnectionListener])
* `options` {Object}
- * `pfx` {string|Buffer} A string or `Buffer` containing the private key,
- certificate and CA certs of the server in PFX or PKCS12 format. (Mutually
- exclusive with the `key`, `cert`, and `ca` options.)
- * `key` {string|string[]|Buffer|Object[]} The private key of the server in
- PEM format. To support multiple keys using different algorithms an array can
- be provided either as a plain array of key strings or an array of objects
- in the format `{pem: key, passphrase: passphrase}`. This option is
- *required* for ciphers that make use of private keys.
- * `passphrase` {string} A string containing the passphrase for the private
- key or pfx.
- * `cert` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of
- strings, or array of `Buffer`s containing the certificate key of the server
- in PEM format. (Required)
- * `ca` {string|string[]|Buffer|Buffer[]} A string, `Buffer`, array of strings,
- or array of `Buffer`s of trusted certificates in PEM format. If this is
- omitted several well known "root" CAs (like VeriSign) will be used. These
- are used to authorize connections.
- * `crl` {string|string[]} Either a string or array of strings of PEM encoded
- CRLs (Certificate Revocation List).
- * `ciphers` {string} A string describing the ciphers to use or exclude,
- separated by `:`.
- * `ecdhCurve` {string} A string describing a named curve to use for ECDH key
- agreement or `false` to disable ECDH. Defaults to `prime256v1` (NIST P-256).
- Use [`crypto.getCurves()`][] to obtain a list of available curve names. On
- recent releases, `openssl ecparam -list_curves` will also display the name
- and description of each available elliptic curve.
- * `dhparam` {string|Buffer} A string or `Buffer` containing Diffie Hellman
- parameters, required for [Perfect Forward Secrecy][]. Use
- `openssl dhparam` to create the parameters. The key length must be greater
- than or equal to 1024 bits, otherwise an error will be thrown. It is
- strongly recommended to use 2048 bits or larger for stronger security. If
- omitted or invalid, the parameters are silently discarded and DHE ciphers
- will not be available.
* `handshakeTimeout` {number} Abort the connection if the SSL/TLS handshake
does not finish in the specified number of milliseconds. Defaults to `120`
seconds. A `'clientError'` is emitted on the `tls.Server` object whenever a
handshake times out.
- * `honorCipherOrder` {boolean} When choosing a cipher, use the server's
- preferences instead of the client preferences. Defaults to `true`.
* `requestCert` {boolean} If `true` the server will request a certificate from
clients that connect and attempt to verify that certificate. Defaults to
`false`.
@@ -1019,58 +996,13 @@ added: v0.3.2
a 16-byte HMAC key, and a 16-byte AES key. This can be used to accept TLS
session tickets on multiple instances of the TLS server. *Note* that this is
automatically shared between `cluster` module workers.
- * `sessionIdContext` {string} A string containing an opaque identifier for
- session resumption. If `requestCert` is `true`, the default is a 128 bit
- truncated SHA1 hash value generated from the command-line. Otherwise, a
- default is not provided.
- * `secureProtocol` {string} The SSL method to use, e.g. `SSLv3_method` to
- force SSL version 3. The possible values depend on the version of OpenSSL
- installed in the environment and are defined in the constant
- [SSL_METHODS][].
+ * ...: Any [`tls.createSecureContext()`][] options can be provided. For
+ servers, the identity options (`pfx` or `key`/`cert`) are usually required.
* `secureConnectionListener` {Function}
Creates a new [tls.Server][]. The `secureConnectionListener`, if provided, is
automatically set as a listener for the [`'secureConnection'`][] event.
-For the `ciphers` option, the default cipher suite is:
-
-```text
-ECDHE-RSA-AES128-GCM-SHA256:
-ECDHE-ECDSA-AES128-GCM-SHA256:
-ECDHE-RSA-AES256-GCM-SHA384:
-ECDHE-ECDSA-AES256-GCM-SHA384:
-DHE-RSA-AES128-GCM-SHA256:
-ECDHE-RSA-AES128-SHA256:
-DHE-RSA-AES128-SHA256:
-ECDHE-RSA-AES256-SHA384:
-DHE-RSA-AES256-SHA384:
-ECDHE-RSA-AES256-SHA256:
-DHE-RSA-AES256-SHA256:
-HIGH:
-!aNULL:
-!eNULL:
-!EXPORT:
-!DES:
-!RC4:
-!MD5:
-!PSK:
-!SRP:
-!CAMELLIA
-```
-
-The default cipher suite prefers GCM ciphers for [Chrome's 'modern
-cryptography' setting] and also prefers ECDHE and DHE ciphers for Perfect
-Forward Secrecy, while offering *some* backward compatibility.
-
-128 bit AES is preferred over 192 and 256 bit AES in light of [specific
-attacks affecting larger AES key sizes].
-
-Old clients that rely on insecure and deprecated RC4 or DES-based ciphers
-(like Internet Explorer 6) cannot complete the handshaking process with
-the default configuration. If these clients _must_ be supported, the
-[TLS recommendations] may offer a compatible cipher suite. For more details
-on the format, see the [OpenSSL cipher list format documentation].
-
The following illustrates a simple echo server:
```js
@@ -1254,6 +1186,8 @@ where `secure_socket` has the same API as `pair.cleartext`.
[OpenSSL cipher list format documentation]: https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-LIST-FORMAT
[Chrome's 'modern cryptography' setting]: https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites
+[OpenSSL Options]: crypto.html#crypto_openssl_options
+[modifying the default cipher suite]: #tls_modifying_the_default_tls_cipher_suite
[specific attacks affecting larger AES key sizes]: https://www.schneier.com/blog/archives/2009/07/another_new_aes.html
[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves
[`tls.createServer()`]: #tls_tls_createserver_options_secureconnectionlistener
diff --git a/doc/api/tty.md b/doc/api/tty.md
index f9be1fc4ffd3e5..8f250e45d655f9 100644
--- a/doc/api/tty.md
+++ b/doc/api/tty.md
@@ -50,6 +50,13 @@ raw device. Defaults to `false`.
added: v0.7.7
-->
+Allows configuration of `tty.ReadStream` so that it operates as a raw device.
+
+When in raw mode, input is always available character-by-character, not
+including modifiers. Additionally, all special processing of characters by the
+terminal is disabled, including echoing input characters.
+Note that `CTRL`+`C` will no longer cause a `SIGINT` when in this mode.
+
* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
raw device. If `false`, configures the `tty.ReadStream` to operate in its
default mode. The `readStream.isRaw` property will be set to the resulting
diff --git a/doc/changelogs/CHANGELOG_V7.md b/doc/changelogs/CHANGELOG_V7.md
index cdb0f692fab7ce..68753cb522d061 100644
--- a/doc/changelogs/CHANGELOG_V7.md
+++ b/doc/changelogs/CHANGELOG_V7.md
@@ -6,7 +6,8 @@
-7.2.1
+7.3.0
+7.2.1 7.2.0 7.1.0 7.0.0
@@ -23,6 +24,158 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)
+
+## 2016-12-20, Version 7.3.0 (Current), @cjihrig
+
+Thank you to @italoacasas for preparing the majority of this release.
+
+### Notable changes
+
+* **buffer**:
+ - buffer.fill() now works properly for the UCS2 encoding on Big-Endian machines. (Anna Henningsen) [#9837](https://github.com/nodejs/node/pull/9837)
+* **cluster**:
+ - disconnect() now returns a reference to the disconnected worker. (Sean Villars) [#10019](https://github.com/nodejs/node/pull/10019)
+* **crypto**:
+ - The built-in list of Well-Known CAs (Certificate Authorities) can now be extended via a NODE_EXTRA_CA_CERTS environment variable. (Sam Roberts) [#9139](https://github.com/nodejs/node/pull/9139)
+* **http**:
+ - Remove stale timeout listeners in order to prevent a memory leak when using keep alive. (Karl Böhlmark) [#9440](https://github.com/nodejs/node/pull/9440)
+* **tls**:
+ - Allow obvious key/passphrase combinations. (Sam Roberts) [#10294](https://github.com/nodejs/node/pull/10294)
+* **url**:
+ - Including base argument in URL.originFor() to meet specification compliance. (joyeecheung) [#10021](https://github.com/nodejs/node/pull/10021)
+ - Improve URLSearchParams to meet specification compliance. (Timothy Gu) [#9484](https://github.com/nodejs/node/pull/9484)
+
+### Commits
+
+* [[`c2cc11b3c6`](https://github.com/nodejs/node/commit/c2cc11b3c6)] - Working on v7.2.2 (Jeremiah Senkpiel) [#10127](https://github.com/nodejs/node/pull/10127)
+* [[`b99a372e91`](https://github.com/nodejs/node/commit/b99a372e91)] - **buffer**: fix single-character string filling (Anna Henningsen) [#9837](https://github.com/nodejs/node/pull/9837)
+* [[`d8b6723096`](https://github.com/nodejs/node/commit/d8b6723096)] - **buffer**: handle UCS2 `.fill()` properly on BE (Anna Henningsen) [#9837](https://github.com/nodejs/node/pull/9837)
+* [[`e61331ee9b`](https://github.com/nodejs/node/commit/e61331ee9b)] - **build**: fix node_g target (Daniel Bevenius) [#10153](https://github.com/nodejs/node/pull/10153)
+* [[`9d04152e15`](https://github.com/nodejs/node/commit/9d04152e15)] - **build**: Don't regenerate node symlink (sxa555) [#9827](https://github.com/nodejs/node/pull/9827)
+* [[`5d14602181`](https://github.com/nodejs/node/commit/5d14602181)] - **(SEMVER-MINOR)** **cluster**: return worker reference from disconnect() (Sean Villars) [#10019](https://github.com/nodejs/node/pull/10019)
+* [[`6963e8aa9d`](https://github.com/nodejs/node/commit/6963e8aa9d)] - **(SEMVER-MINOR)** **crypto**: allow adding extra certs to well-known CAs (Sam Roberts) [#9139](https://github.com/nodejs/node/pull/9139)
+* [[`a308a2fae4`](https://github.com/nodejs/node/commit/a308a2fae4)] - **deps**: cherry-pick 081fce3 from V8 upstream (Matt Loring) [#10342](https://github.com/nodejs/node/pull/10342)
+* [[`7c3d280bf0`](https://github.com/nodejs/node/commit/7c3d280bf0)] - **doc**: rework tls for accuracy and clarity (Sam Roberts) [#9800](https://github.com/nodejs/node/pull/9800)
+* [[`6b98906a08`](https://github.com/nodejs/node/commit/6b98906a08)] - **doc**: document R CRAN mirror process (Lucas Holmquist) [#10211](https://github.com/nodejs/node/pull/10211)
+* [[`7e8c5e3490`](https://github.com/nodejs/node/commit/7e8c5e3490)] - **doc**: expand common module material in test guide (Rich Trott) [#10251](https://github.com/nodejs/node/pull/10251)
+* [[`ee736b276c`](https://github.com/nodejs/node/commit/ee736b276c)] - **doc**: fix broken link in COLLABORATOR_GUIDE.md (Michael Dawson) [#10267](https://github.com/nodejs/node/pull/10267)
+* [[`40b0ca1329`](https://github.com/nodejs/node/commit/40b0ca1329)] - **doc**: fix typo in code example of 'path' module (pallxk) [#10136](https://github.com/nodejs/node/pull/10136)
+* [[`b44e7891d0`](https://github.com/nodejs/node/commit/b44e7891d0)] - **doc**: standardizing on make -j4 (Jonathan Darling) [#9961](https://github.com/nodejs/node/pull/9961)
+* [[`ff8fdb14fb`](https://github.com/nodejs/node/commit/ff8fdb14fb)] - **doc**: add note to parallelize make (Jonathan Darling) [#9961](https://github.com/nodejs/node/pull/9961)
+* [[`5a64187bed`](https://github.com/nodejs/node/commit/5a64187bed)] - **doc**: buffer allocation throws for negative size (joyeecheung) [#10151](https://github.com/nodejs/node/pull/10151)
+* [[`20fdf3aec6`](https://github.com/nodejs/node/commit/20fdf3aec6)] - **doc**: add some info on `tty#setRawMode()` (Jeremiah Senkpiel) [#10147](https://github.com/nodejs/node/pull/10147)
+* [[`ae53a6e12b`](https://github.com/nodejs/node/commit/ae53a6e12b)] - **doc**: update `path.format` description and examples (anoff) [#10046](https://github.com/nodejs/node/pull/10046)
+* [[`30340388f1`](https://github.com/nodejs/node/commit/30340388f1)] - **doc**: add a variable declaration in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`d64e52c68d`](https://github.com/nodejs/node/commit/d64e52c68d)] - **doc**: adding missing - in README (Italo A. Casas) [#10170](https://github.com/nodejs/node/pull/10170)
+* [[`39bf5bfaf1`](https://github.com/nodejs/node/commit/39bf5bfaf1)] - **doc**: removing extra space in README (Italo A. Casas) [#10168](https://github.com/nodejs/node/pull/10168)
+* [[`bc64a63440`](https://github.com/nodejs/node/commit/bc64a63440)] - **doc**: fix a wrong note in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`d4c73d4823`](https://github.com/nodejs/node/commit/d4c73d4823)] - **doc**: remove an extraneous word in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`d373b2f2fb`](https://github.com/nodejs/node/commit/d373b2f2fb)] - **doc**: fix examples in buffer.md to avoid confusion (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`7a39a44dbc`](https://github.com/nodejs/node/commit/7a39a44dbc)] - **doc**: remove a wrong remark in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`39b083eb51`](https://github.com/nodejs/node/commit/39b083eb51)] - **doc**: repeat a remark as needed in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`622690f242`](https://github.com/nodejs/node/commit/622690f242)] - **doc**: fix copy-paste artifacts in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`3b848a279b`](https://github.com/nodejs/node/commit/3b848a279b)] - **doc**: fix wrong function arguments in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`9e47b943a7`](https://github.com/nodejs/node/commit/9e47b943a7)] - **doc**: fix a syntax error in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`1864222d50`](https://github.com/nodejs/node/commit/1864222d50)] - **doc**: var => const/let in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795)
+* [[`7b924f1713`](https://github.com/nodejs/node/commit/7b924f1713)] - **doc**: fix typo in ecdhCurve, a tls property name (Sam Roberts) [#10345](https://github.com/nodejs/node/pull/10345)
+* [[`2673be676a`](https://github.com/nodejs/node/commit/2673be676a)] - **fs**: remove unused argument from copyObject() (Ethan Arrowood) [#10041](https://github.com/nodejs/node/pull/10041)
+* [[`1081f0f33d`](https://github.com/nodejs/node/commit/1081f0f33d)] - **fs**: remove needless assignment of null (Francis Gulotta) [#10260](https://github.com/nodejs/node/pull/10260)
+* [[`dded482bb8`](https://github.com/nodejs/node/commit/dded482bb8)] - **http**: remove stale timeout listeners (Karl Böhlmark) [#9440](https://github.com/nodejs/node/pull/9440)
+* [[`b41db3396b`](https://github.com/nodejs/node/commit/b41db3396b)] - **inspector**: check if connected before waiting (Eugene Ostroukhov) [#10094](https://github.com/nodejs/node/pull/10094)
+* [[`b6a8bc6ac3`](https://github.com/nodejs/node/commit/b6a8bc6ac3)] - **lib,test**: use consistent operator linebreak style (Michaël Zasso) [#10178](https://github.com/nodejs/node/pull/10178)
+* [[`ef2fa56314`](https://github.com/nodejs/node/commit/ef2fa56314)] - **src**: fix string format mistake for 32 bit node (Alex Newman) [#10082](https://github.com/nodejs/node/pull/10082)
+* [[`d4e160c946`](https://github.com/nodejs/node/commit/d4e160c946)] - **(SEMVER-MINOR)** **src**: add wrapper for process.emitWarning() (Sam Roberts) [#9139](https://github.com/nodejs/node/pull/9139)
+* [[`ec2f13fe66`](https://github.com/nodejs/node/commit/ec2f13fe66)] - **src**: don't overwrite non-writable vm globals (Ben Noordhuis) [#10227](https://github.com/nodejs/node/pull/10227)
+* [[`28ffd593e2`](https://github.com/nodejs/node/commit/28ffd593e2)] - **stream, test**: test _readableState.emittedReadable (Joyee Cheung) [#10249](https://github.com/nodejs/node/pull/10249)
+* [[`729fecf390`](https://github.com/nodejs/node/commit/729fecf390)] - **stream_base**: homogenize req_wrap_obj use (Fedor Indutny) [#10184](https://github.com/nodejs/node/pull/10184)
+* [[`8b9131c1f8`](https://github.com/nodejs/node/commit/8b9131c1f8)] - **test**: tls key/cert ordering not necessary (Sam Roberts) [#9800](https://github.com/nodejs/node/pull/9800)
+* [[`8a34e60b41`](https://github.com/nodejs/node/commit/8a34e60b41)] - **test**: var to const in tls-no-cert-required (Sam Roberts) [#9800](https://github.com/nodejs/node/pull/9800)
+* [[`ea16a2ab52`](https://github.com/nodejs/node/commit/ea16a2ab52)] - **test**: stream readable needReadable state (Joyee Cheung) [#10241](https://github.com/nodejs/node/pull/10241)
+* [[`e4b29a57f9`](https://github.com/nodejs/node/commit/e4b29a57f9)] - **test**: refactor test-fs-read-stream-inherit (Rich Trott) [#10246](https://github.com/nodejs/node/pull/10246)
+* [[`fb297cba8f`](https://github.com/nodejs/node/commit/fb297cba8f)] - **test**: refactor test-dgram-send-callback-multi-buffer (mfrance) [#9999](https://github.com/nodejs/node/pull/9999)
+* [[`16fbd4f6bf`](https://github.com/nodejs/node/commit/16fbd4f6bf)] - **test**: refactor test-tls-ecdh-disable (Aaron Williams) [#9989](https://github.com/nodejs/node/pull/9989)
+* [[`46c55a6454`](https://github.com/nodejs/node/commit/46c55a6454)] - **test**: cleanup test-stdout-close-catch.js (Travis Bretton) [#10006](https://github.com/nodejs/node/pull/10006)
+* [[`8c8b1230da`](https://github.com/nodejs/node/commit/8c8b1230da)] - **test**: use const/let and common.mustCall (Outsider) [#9959](https://github.com/nodejs/node/pull/9959)
+* [[`74563f07e9`](https://github.com/nodejs/node/commit/74563f07e9)] - **test**: refactor domain test (Adao Junior) [#10269](https://github.com/nodejs/node/pull/10269)
+* [[`d9cfd5484f`](https://github.com/nodejs/node/commit/d9cfd5484f)] - **test**: clean up domain-no-error-handler test (weyj4) [#10291](https://github.com/nodejs/node/pull/10291)
+* [[`553a32674a`](https://github.com/nodejs/node/commit/553a32674a)] - **test**: fix http-client-timeout-option-listeners (Rich Trott) [#10224](https://github.com/nodejs/node/pull/10224)
+* [[`308cead66e`](https://github.com/nodejs/node/commit/308cead66e)] - **test**: update test-domain-uncaught-exception.js (Andy Chen) [#10193](https://github.com/nodejs/node/pull/10193)
+* [[`60542cb98b`](https://github.com/nodejs/node/commit/60542cb98b)] - **test**: refactor test-domain.js (Siddhartha Sahai) [#10207](https://github.com/nodejs/node/pull/10207)
+* [[`c0800d9449`](https://github.com/nodejs/node/commit/c0800d9449)] - **test**: refactor test-stream-big-push (Rich Trott) [#10226](https://github.com/nodejs/node/pull/10226)
+* [[`b9361cae6e`](https://github.com/nodejs/node/commit/b9361cae6e)] - **test**: refactor test-http-dns-fail (Adrian Estrada) [#10243](https://github.com/nodejs/node/pull/10243)
+* [[`a97f26476d`](https://github.com/nodejs/node/commit/a97f26476d)] - **test**: refactor test-crypto-random (Rich Trott) [#10232](https://github.com/nodejs/node/pull/10232)
+* [[`2f9c8d977f`](https://github.com/nodejs/node/commit/2f9c8d977f)] - **test**: refactor test-http-pause-resume-one-end (Rich Trott) [#10210](https://github.com/nodejs/node/pull/10210)
+* [[`90659bc95c`](https://github.com/nodejs/node/commit/90659bc95c)] - **test**: fix flaky test-dgram-exclusive-implicit-bind (Rich Trott) [#10212](https://github.com/nodejs/node/pull/10212)
+* [[`a4f3080595`](https://github.com/nodejs/node/commit/a4f3080595)] - **test**: improvements in test fixtures symlinked (Adrian Estrada) [#10182](https://github.com/nodejs/node/pull/10182)
+* [[`d5e30a69e2`](https://github.com/nodejs/node/commit/d5e30a69e2)] - **test**: refactor test-fs-fsync (Rob Adelmann) [#10176](https://github.com/nodejs/node/pull/10176)
+* [[`be87441463`](https://github.com/nodejs/node/commit/be87441463)] - **test**: refactor test-http-after-connect.js (larissayvette) [#10229](https://github.com/nodejs/node/pull/10229)
+* [[`2b78212445`](https://github.com/nodejs/node/commit/2b78212445)] - **test**: use strictEqual in test-debug-break (Adrian Estrada) [#10181](https://github.com/nodejs/node/pull/10181)
+* [[`8b698d89ac`](https://github.com/nodejs/node/commit/8b698d89ac)] - **test**: refactor assert.equal, update syntax to ES6 (Prieto, Marcos) [#10190](https://github.com/nodejs/node/pull/10190)
+* [[`3749dc6ce7`](https://github.com/nodejs/node/commit/3749dc6ce7)] - **test**: refactor http pipelined socket test (Rich Trott) [#10189](https://github.com/nodejs/node/pull/10189)
+* [[`e1d813f3f8`](https://github.com/nodejs/node/commit/e1d813f3f8)] - **test**: refactor test-handle-wrap-close-abort (Rich Trott) [#10188](https://github.com/nodejs/node/pull/10188)
+* [[`7f01484a7a`](https://github.com/nodejs/node/commit/7f01484a7a)] - **test**: add ES6 and strictEqual to test-fs-truncate (Adrian Estrada) [#10167](https://github.com/nodejs/node/pull/10167)
+* [[`88839cf204`](https://github.com/nodejs/node/commit/88839cf204)] - **test**: replace var with const in test-require-dot (Amar Zavery) [#9916](https://github.com/nodejs/node/pull/9916)
+* [[`09ec5db10b`](https://github.com/nodejs/node/commit/09ec5db10b)] - **test**: fail for missing output files (Anna Henningsen) [#10150](https://github.com/nodejs/node/pull/10150)
+* [[`3f269cc760`](https://github.com/nodejs/node/commit/3f269cc760)] - **test**: use ES6 in test-debugger-client.js (Adrian Estrada) [#10183](https://github.com/nodejs/node/pull/10183)
+* [[`1f11deb58f`](https://github.com/nodejs/node/commit/1f11deb58f)] - **test**: improve buffer transcode (Johnny Reading) [#10043](https://github.com/nodejs/node/pull/10043)
+* [[`3e8df733e8`](https://github.com/nodejs/node/commit/3e8df733e8)] - **test**: improving crypto fips (James Tenenbaum) [#10002](https://github.com/nodejs/node/pull/10002)
+* [[`6780c0e572`](https://github.com/nodejs/node/commit/6780c0e572)] - **test**: stream readableState readingMore state (Gregory) [#9868](https://github.com/nodejs/node/pull/9868)
+* [[`c792e2ac49`](https://github.com/nodejs/node/commit/c792e2ac49)] - **test**: stream readableListening internal state (Italo A. Casas) [#9864](https://github.com/nodejs/node/pull/9864)
+* [[`28c6df2604`](https://github.com/nodejs/node/commit/28c6df2604)] - **test**: add stdin-setrawmode.out file (Jonathan Darling) [#10149](https://github.com/nodejs/node/pull/10149)
+* [[`f5347abac8`](https://github.com/nodejs/node/commit/f5347abac8)] - **test**: set stdin too for pseudo-tty tests (Anna Henningsen) [#10149](https://github.com/nodejs/node/pull/10149)
+* [[`3a460d5469`](https://github.com/nodejs/node/commit/3a460d5469)] - **test**: check for error on invalid signal (Matt Phillips) [#10026](https://github.com/nodejs/node/pull/10026)
+* [[`1ebb5b9adb`](https://github.com/nodejs/node/commit/1ebb5b9adb)] - **test**: refactor test-http-unix-socket (davidmarkclements) [#10072](https://github.com/nodejs/node/pull/10072)
+* [[`8b7c97bc59`](https://github.com/nodejs/node/commit/8b7c97bc59)] - **test**: increase test coverage of BufferList (joyeecheung) [#10171](https://github.com/nodejs/node/pull/10171)
+* [[`53e8e962d4`](https://github.com/nodejs/node/commit/53e8e962d4)] - **test**: fix flaky test-net-socket-timeout (Rich Trott) [#10172](https://github.com/nodejs/node/pull/10172)
+* [[`ca38f70dea`](https://github.com/nodejs/node/commit/ca38f70dea)] - **test**: refactor test-net-keepalive.js (Kyle Corsi) [#9995](https://github.com/nodejs/node/pull/9995)
+* [[`a9d4bd7a34`](https://github.com/nodejs/node/commit/a9d4bd7a34)] - **test**: refactor test-crypto-hmac (eudaimos) [#9958](https://github.com/nodejs/node/pull/9958)
+* [[`778e5f7d0c`](https://github.com/nodejs/node/commit/778e5f7d0c)] - **test**: fix error in test-cluster-worker-death.js (Bruce Lai) [#9981](https://github.com/nodejs/node/pull/9981)
+* [[`b67cad1174`](https://github.com/nodejs/node/commit/b67cad1174)] - **test**: use `assert.strictEqual` (anoff) [#9975](https://github.com/nodejs/node/pull/9975)
+* [[`72fb05d062`](https://github.com/nodejs/node/commit/72fb05d062)] - **test**: change assert.equal to assert.strictEqual (Aileen) [#9946](https://github.com/nodejs/node/pull/9946)
+* [[`dac757e502`](https://github.com/nodejs/node/commit/dac757e502)] - **test**: changed assert.equal to assert.strictEqual (vazina robertson) [#10015](https://github.com/nodejs/node/pull/10015)
+* [[`d7988e0355`](https://github.com/nodejs/node/commit/d7988e0355)] - **test**: renamed assert.Equal to assert.strictEqual (Jared Young)
+* [[`9d037cfa44`](https://github.com/nodejs/node/commit/9d037cfa44)] - **test**: improves test-tls-client-verify (Paul Graham) [#10051](https://github.com/nodejs/node/pull/10051)
+* [[`2565e48445`](https://github.com/nodejs/node/commit/2565e48445)] - **test**: refactor test-https-agent-session-reuse (Diego Paez) [#10105](https://github.com/nodejs/node/pull/10105)
+* [[`11140802f4`](https://github.com/nodejs/node/commit/11140802f4)] - **test**: refactor test-beforeexit-event (Rob Adelmann) [#10121](https://github.com/nodejs/node/pull/10121)
+* [[`e695862531`](https://github.com/nodejs/node/commit/e695862531)] - **test**: improve test-fs-read-stream.js (Jenna Vuong) [#9629](https://github.com/nodejs/node/pull/9629)
+* [[`be90638487`](https://github.com/nodejs/node/commit/be90638487)] - **test**: refactor test-domain-from-timer (Daniel Sims) [#9889](https://github.com/nodejs/node/pull/9889)
+* [[`2c5d5629de`](https://github.com/nodejs/node/commit/2c5d5629de)] - **test**: refactor test-domain-exit-dispose-again (Ethan Arrowood) [#10003](https://github.com/nodejs/node/pull/10003)
+* [[`6d4f270f2f`](https://github.com/nodejs/node/commit/6d4f270f2f)] - **test**: use const and strictEqual in test-os-homedir-no-envvar (CodeVana) [#9899](https://github.com/nodejs/node/pull/9899)
+* [[`62f5a0bf59`](https://github.com/nodejs/node/commit/62f5a0bf59)] - **test**: check result of uv_loop_init and uv_write (Ben Noordhuis) [#10126](https://github.com/nodejs/node/pull/10126)
+* [[`19432f05ff`](https://github.com/nodejs/node/commit/19432f05ff)] - **test**: refactor test-dgram-bind-default-address (Michael-Bryant Choa) [#9947](https://github.com/nodejs/node/pull/9947)
+* [[`01509bc67e`](https://github.com/nodejs/node/commit/01509bc67e)] - **test**: move long-running test to sequential (Rich Trott) [#10161](https://github.com/nodejs/node/pull/10161)
+* [[`d8dc890352`](https://github.com/nodejs/node/commit/d8dc890352)] - **test**: assert.throws() should include a RegExp (Chris Bystrek) [#9976](https://github.com/nodejs/node/pull/9976)
+* [[`6f2f02d5ad`](https://github.com/nodejs/node/commit/6f2f02d5ad)] - **test**: invalid package.json causes error when require()ing in directory (Sam Shull) [#10044](https://github.com/nodejs/node/pull/10044)
+* [[`6489a91027`](https://github.com/nodejs/node/commit/6489a91027)] - **test**: refactor test-listen-fd-ebadf (Richard Karmazin) [#10034](https://github.com/nodejs/node/pull/10034)
+* [[`eb1664bed9`](https://github.com/nodejs/node/commit/eb1664bed9)] - **test**: refactor test-event-emitter-method-names (Rodrigo Palma) [#10027](https://github.com/nodejs/node/pull/10027)
+* [[`c66cf2c1cf`](https://github.com/nodejs/node/commit/c66cf2c1cf)] - **test**: refactor tls-ticket-cluster (Yojan Shrestha) [#10023](https://github.com/nodejs/node/pull/10023)
+* [[`de9972678e`](https://github.com/nodejs/node/commit/de9972678e)] - **test**: refactor test-domain-exit-dispose (Chris Henney) [#9938](https://github.com/nodejs/node/pull/9938)
+* [[`5ca90777e6`](https://github.com/nodejs/node/commit/5ca90777e6)] - **test**: refactor test-stdin-from-file.js (amrios) [#10012](https://github.com/nodejs/node/pull/10012)
+* [[`4d66578997`](https://github.com/nodejs/node/commit/4d66578997)] - **test**: use ES6 to update let & const (Jason Humphrey) [#9917](https://github.com/nodejs/node/pull/9917)
+* [[`bb9174745b`](https://github.com/nodejs/node/commit/bb9174745b)] - **test**: fix test for buffer regression #649 (joyeecheung) [#9924](https://github.com/nodejs/node/pull/9924)
+* [[`613798335c`](https://github.com/nodejs/node/commit/613798335c)] - **test**: stream readable resumeScheduled state (Italo A. Casas) [#10299](https://github.com/nodejs/node/pull/10299)
+* [[`15c71f6c66`](https://github.com/nodejs/node/commit/15c71f6c66)] - **test**: improve code in test-fs-open.js (Adrian Estrada) [#10312](https://github.com/nodejs/node/pull/10312)
+* [[`793d8719eb`](https://github.com/nodejs/node/commit/793d8719eb)] - **test**: fix flaky test-debug-port (Santiago Gimeno) [#10316](https://github.com/nodejs/node/pull/10316)
+* [[`5e781a3883`](https://github.com/nodejs/node/commit/5e781a3883)] - **test**: refactor the code in test-dns-ipv6 (Adrian Estrada) [#10219](https://github.com/nodejs/node/pull/10219)
+* [[`8b367c5ddd`](https://github.com/nodejs/node/commit/8b367c5ddd)] - **test**: improve test-child-process-fork-and-spawn (Adrian Estrada) [#10273](https://github.com/nodejs/node/pull/10273)
+* [[`348e69c89d`](https://github.com/nodejs/node/commit/348e69c89d)] - **test**: fix flaky test-http-client-timeout-event (Rich Trott) [#10293](https://github.com/nodejs/node/pull/10293)
+* [[`0d3ac89ff7`](https://github.com/nodejs/node/commit/0d3ac89ff7)] - **test**: add known_issues test for #6287 (AnnaMag) [#10272](https://github.com/nodejs/node/pull/10272)
+* [[`f7f662cad5`](https://github.com/nodejs/node/commit/f7f662cad5)] - **test**: improve test-child-process-exec-buffer (Adrian Estrada) [#10275](https://github.com/nodejs/node/pull/10275)
+* [[`f66461382c`](https://github.com/nodejs/node/commit/f66461382c)] - **timers**: fix handling of cleared immediates (hveldstra) [#9759](https://github.com/nodejs/node/pull/9759)
+* [[`8e4b9fa487`](https://github.com/nodejs/node/commit/8e4b9fa487)] - **tls**: fix/annotate connect arg comments (Sam Roberts) [#9800](https://github.com/nodejs/node/pull/9800)
+* [[`980acb4b95`](https://github.com/nodejs/node/commit/980acb4b95)] - **tls**: document and test option-less createServer (Sam Roberts) [#9800](https://github.com/nodejs/node/pull/9800)
+* [[`41e1e6eb35`](https://github.com/nodejs/node/commit/41e1e6eb35)] - **tls**: do not refer to secureOptions as flags (Sam Roberts) [#9800](https://github.com/nodejs/node/pull/9800)
+* [[`0b44384561`](https://github.com/nodejs/node/commit/0b44384561)] - **(SEMVER-MINOR)** **tls**: allow obvious key/passphrase combinations (Sam Roberts) [#10294](https://github.com/nodejs/node/pull/10294)
+* [[`a92f2ad19c`](https://github.com/nodejs/node/commit/a92f2ad19c)] - **tools**: enforce consistent operator linebreak style (Michaël Zasso) [#10178](https://github.com/nodejs/node/pull/10178)
+* [[`cc5bd9a0cf`](https://github.com/nodejs/node/commit/cc5bd9a0cf)] - **tools**: add macosx-firwall script to avoid popups (Daniel Bevenius) [#10114](https://github.com/nodejs/node/pull/10114)
+* [[`7cb98138a9`](https://github.com/nodejs/node/commit/7cb98138a9)] - **tools**: forbid template literals in assert.throws (Michaël Zasso) [#10301](https://github.com/nodejs/node/pull/10301)
+* [[`24482d08ce`](https://github.com/nodejs/node/commit/24482d08ce)] - **(SEMVER-MINOR)** **url**: add inspect function to TupleOrigin (Safia Abdalla) [#10039](https://github.com/nodejs/node/pull/10039)
+* [[`f08d8a6c6f`](https://github.com/nodejs/node/commit/f08d8a6c6f)] - **url**: improve URLSearchParams spec compliance (Timothy Gu) [#9484](https://github.com/nodejs/node/pull/9484)
+* [[`19d7197177`](https://github.com/nodejs/node/commit/19d7197177)] - **url**: add a got host pattern in url.js (Axel Monroy) [#9653](https://github.com/nodejs/node/pull/9653)
+* [[`2da71f24de`](https://github.com/nodejs/node/commit/2da71f24de)] - **url, test**: fix typo in inspect output, add test (Jay Brownlee) [#10231](https://github.com/nodejs/node/pull/10231)
+* [[`80cccce218`](https://github.com/nodejs/node/commit/80cccce218)] - **url, test**: including base argument in originFor (joyeecheung) [#10021](https://github.com/nodejs/node/pull/10021)
+* [[`7a0fe9f471`](https://github.com/nodejs/node/commit/7a0fe9f471)] - **win,msi**: add required UIRef for localized strings (Bill Ticehurst) [#8884](https://github.com/nodejs/node/pull/8884)
+
## 2016-12-06, Version 7.2.1 (Current), @Fishrock123
diff --git a/doc/guides/building-node-with-ninja.md b/doc/guides/building-node-with-ninja.md
index 027c267e2b243d..29b32c3d7277de 100644
--- a/doc/guides/building-node-with-ninja.md
+++ b/doc/guides/building-node-with-ninja.md
@@ -16,7 +16,7 @@ ninja: Entering directory `out/Release`
The bottom line will change while building, showing the progress as `[finished/total]` build steps.
This is useful output that `make` does not produce and is one of the benefits of using Ninja.
-Also, Ninja will likely compile much faster than even `make -j8` (or `-j`).
+Also, Ninja will likely compile much faster than even `make -j4` (or `-j`).
## Considerations
diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md
index d00be9cdbcc4c6..d628e3f6f5873c 100644
--- a/doc/guides/writing-tests.md
+++ b/doc/guides/writing-tests.md
@@ -19,7 +19,6 @@ Tests can be added for multiple reasons:
- When fixing regressions and bugs.
- When expanding test coverage.
-
## Test structure
Let's analyze this very basic test from the Node.js test suite:
@@ -55,17 +54,22 @@ Let's analyze this very basic test from the Node.js test suite:
const common = require('../common');
```
-These two lines are mandatory and should be included on every test.
-The `common` module is a helper module that provides useful tools for the tests.
-If for some reason, no functionality from `common` is used, it should still be
-included like this:
+The first line enables strict mode. All tests should be in strict mode unless
+the nature of the test requires that the test run without it.
+
+The second line loads the `common` module. The `common` module is a helper
+module that provides useful tools for the tests.
+
+Even if no functions or other properties exported by `common` are used in a
+test, the `common` module should still be included. This is because the `common`
+module includes code that will cause tests to fail if variables are leaked into
+the global space. In situations where no functions or other properties exported
+by `common` are used, it can be included without assigning it to an identifier:
```javascript
require('../common');
```
-Why? It checks for leaks of globals.
-
**Lines 4-5**
```javascript
@@ -76,7 +80,6 @@ Why? It checks for leaks of globals.
A test should start with a comment containing a brief description of what it is
designed to test.
-
**Lines 7-8**
```javascript
diff --git a/doc/onboarding-extras.md b/doc/onboarding-extras.md
index 7b7f60fd00705b..9e1a4a7ed7b14b 100644
--- a/doc/onboarding-extras.md
+++ b/doc/onboarding-extras.md
@@ -71,7 +71,7 @@ Please use these when possible / appropriate
* major vs. everything else: run last versions tests against this version, if they pass, **probably** minor or patch
* A breaking change helper ([full source](https://gist.github.com/chrisdickinson/ba532fa0e4e243fb7b44)):
```sh
- git checkout $(git show -s --pretty='%T' $(git show-ref -d $(git describe --abbrev=0) | tail -n1 | awk '{print $1}')) -- test; make -j8 test
+ git checkout $(git show -s --pretty='%T' $(git show-ref -d $(git describe --abbrev=0) | tail -n1 | awk '{print $1}')) -- test; make -j4 test
```
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 6837c94df98eea..1846e36e12bf88 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -562,7 +562,13 @@ function tickOnSocket(req, socket) {
socket.on('close', socketCloseListener);
if (req.timeout) {
- socket.once('timeout', () => req.emit('timeout'));
+ const emitRequestTimeout = () => req.emit('timeout');
+ socket.once('timeout', emitRequestTimeout);
+ req.once('response', (res) => {
+ res.once('end', () => {
+ socket.removeListener('timeout', emitRequestTimeout);
+ });
+ });
}
req.emit('socket', socket);
}
diff --git a/lib/_tls_common.js b/lib/_tls_common.js
index 6e98c1ee4d66d2..85ae71f8d15cc1 100644
--- a/lib/_tls_common.js
+++ b/lib/_tls_common.js
@@ -12,9 +12,9 @@ var crypto = null;
const binding = process.binding('crypto');
const NativeSecureContext = binding.SecureContext;
-function SecureContext(secureProtocol, flags, context) {
+function SecureContext(secureProtocol, secureOptions, context) {
if (!(this instanceof SecureContext)) {
- return new SecureContext(secureProtocol, flags, context);
+ return new SecureContext(secureProtocol, secureOptions, context);
}
if (context) {
@@ -29,7 +29,7 @@ function SecureContext(secureProtocol, flags, context) {
}
}
- if (flags) this.context.setOptions(flags);
+ if (secureOptions) this.context.setOptions(secureOptions);
}
exports.SecureContext = SecureContext;
@@ -78,17 +78,11 @@ exports.createSecureContext = function createSecureContext(options, context) {
if (Array.isArray(options.key)) {
for (i = 0; i < options.key.length; i++) {
const key = options.key[i];
- if (key.passphrase)
- c.context.setKey(key.pem, key.passphrase);
- else
- c.context.setKey(key);
+ const passphrase = key.passphrase || options.passphrase;
+ c.context.setKey(key.pem || key, passphrase);
}
} else {
- if (options.passphrase) {
- c.context.setKey(options.key, options.passphrase);
- } else {
- c.context.setKey(options.key);
- }
+ c.context.setKey(options.key, options.passphrase);
}
}
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index d9dafceb950dc7..434384cec81595 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -745,18 +745,19 @@ TLSSocket.prototype.getProtocol = function() {
// "PATH_LENGTH_EXCEEDED", "INVALID_PURPOSE" "CERT_UNTRUSTED",
// "CERT_REJECTED"
//
-function Server(/* [options], listener */) {
- var options, listener;
+function Server(options, listener) {
+ if (!(this instanceof Server))
+ return new Server(options, listener);
- if (arguments[0] !== null && typeof arguments[0] === 'object') {
- options = arguments[0];
- listener = arguments[1];
- } else if (typeof arguments[0] === 'function') {
+ if (typeof options === 'function') {
+ listener = options;
options = {};
- listener = arguments[0];
+ } else if (options == null || typeof options === 'object') {
+ options = options || {};
+ } else {
+ throw new TypeError('options must be an object');
}
- if (!(this instanceof Server)) return new Server(options, listener);
this._contexts = [];
@@ -975,6 +976,11 @@ function normalizeConnectArgs(listArgs) {
var options = args[0];
var cb = args[1];
+ // If args[0] was options, then normalize dealt with it.
+ // If args[0] is port, or args[0], args[1] is host,port, we need to
+ // find the options and merge them in, normalize's options has only
+ // the host/port/path args that it knows about, not the tls options.
+ // This means that options.host overrides a host arg.
if (listArgs[1] !== null && typeof listArgs[1] === 'object') {
options = util._extend(options, listArgs[1]);
} else if (listArgs[2] !== null && typeof listArgs[2] === 'object') {
@@ -984,7 +990,7 @@ function normalizeConnectArgs(listArgs) {
return (cb) ? [options, cb] : [options];
}
-exports.connect = function(/* [port, host], options, cb */) {
+exports.connect = function(/* [port,] [host,] [options,] [cb] */) {
const argsLen = arguments.length;
var args = new Array(argsLen);
for (var i = 0; i < argsLen; i++)
diff --git a/lib/buffer.js b/lib/buffer.js
index 3453f5fe8cd6ae..557ac867e2e0fc 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -672,23 +672,27 @@ Buffer.prototype.fill = function fill(val, start, end, encoding) {
encoding = end;
end = this.length;
}
- if (val.length === 1) {
- var code = val.charCodeAt(0);
- if (code < 256)
- val = code;
- }
- if (val.length === 0) {
- // Previously, if val === '', the Buffer would not fill,
- // which is rather surprising.
- val = 0;
- }
+
if (encoding !== undefined && typeof encoding !== 'string') {
throw new TypeError('encoding must be a string');
}
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ var normalizedEncoding = internalUtil.normalizeEncoding(encoding);
+ if (normalizedEncoding === undefined) {
throw new TypeError('Unknown encoding: ' + encoding);
}
+ if (val.length === 0) {
+ // Previously, if val === '', the Buffer would not fill,
+ // which is rather surprising.
+ val = 0;
+ } else if (val.length === 1) {
+ var code = val.charCodeAt(0);
+ if ((normalizedEncoding === 'utf8' && code < 128) ||
+ normalizedEncoding === 'latin1') {
+ // Fast path: If `val` fits into a single byte, use that numeric value.
+ val = code;
+ }
+ }
} else if (typeof val === 'number') {
val = val & 255;
}
diff --git a/lib/cluster.js b/lib/cluster.js
index 67e8833941789a..e95e19bcc672d4 100644
--- a/lib/cluster.js
+++ b/lib/cluster.js
@@ -430,6 +430,7 @@ function masterInit() {
send(this, { act: 'disconnect' });
removeHandlesForWorker(this);
removeWorker(this);
+ return this;
};
Worker.prototype.destroy = function(signo) {
@@ -687,6 +688,7 @@ function workerInit() {
Worker.prototype.disconnect = function() {
_disconnect.call(this);
+ return this;
};
Worker.prototype.destroy = function() {
diff --git a/lib/fs.js b/lib/fs.js
index 27614e5cf1febc..52f392d749364c 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -56,8 +56,8 @@ function getOptions(options, defaultOptions) {
return options;
}
-function copyObject(source, target) {
- target = arguments.length >= 2 ? target : {};
+function copyObject(source) {
+ const target = {};
for (const key in source)
target[key] = source[key];
return target;
@@ -1794,7 +1794,6 @@ ReadStream.prototype._read = function(n) {
if (!pool || pool.length - pool.used < kMinPoolSpace) {
// discard the old pool.
- pool = null;
allocNewPool(this._readableState.highWaterMark);
}
diff --git a/lib/internal/url.js b/lib/internal/url.js
index 79b9e1cb0f46bb..ba54aa8c233354 100644
--- a/lib/internal/url.js
+++ b/lib/internal/url.js
@@ -20,6 +20,11 @@ const kHost = Symbol('host');
const kPort = Symbol('port');
const kDomain = Symbol('domain');
+// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
+const IteratorPrototype = Object.getPrototypeOf(
+ Object.getPrototypeOf([][Symbol.iterator]())
+);
+
function StorageObject() {}
StorageObject.prototype = Object.create(null);
@@ -69,6 +74,15 @@ class TupleOrigin {
result += `:${this.port}`;
return result;
}
+
+ inspect() {
+ return `TupleOrigin {
+ scheme: ${this.scheme},
+ host: ${this.host},
+ port: ${this.port},
+ domain: ${this.domain}
+ }`;
+ }
}
class URL {
@@ -92,7 +106,8 @@ class URL {
this[context].query = query;
this[context].fragment = fragment;
this[context].host = host;
- this[searchParams] = new URLSearchParams(this);
+ this[searchParams] = new URLSearchParams(query);
+ this[searchParams][context] = this;
});
}
@@ -309,8 +324,31 @@ class URL {
}
set search(search) {
- update(this, search);
- this[searchParams][searchParams] = querystring.parse(this.search);
+ search = String(search);
+ if (search[0] === '?') search = search.slice(1);
+ if (!search) {
+ this[context].query = null;
+ this[context].flags &= ~binding.URL_FLAGS_HAS_QUERY;
+ this[searchParams][searchParams] = {};
+ return;
+ }
+ this[context].query = '';
+ binding.parse(search,
+ binding.kQuery,
+ null,
+ this[context],
+ (flags, protocol, username, password,
+ host, port, path, query, fragment) => {
+ if (flags & binding.URL_FLAGS_FAILED)
+ return;
+ if (query) {
+ this[context].query = query;
+ this[context].flags |= binding.URL_FLAGS_HAS_QUERY;
+ } else {
+ this[context].flags &= ~binding.URL_FLAGS_HAS_QUERY;
+ }
+ });
+ this[searchParams][searchParams] = querystring.parse(search);
}
get hash() {
@@ -411,7 +449,7 @@ class URL {
ret += ` hash: ${this.hash}\n`;
if (opts.showHidden) {
ret += ` cannot-be-base: ${this[cannotBeBase]}\n`;
- ret += ` special: ${this[special]}\n;`;
+ ret += ` special: ${this[special]}\n`;
}
ret += '}';
return ret;
@@ -484,76 +522,129 @@ function encodeAuth(str) {
return out;
}
-function update(url, search) {
- search = String(search);
- if (!search) {
- url[context].query = null;
- url[context].flags &= ~binding.URL_FLAGS_HAS_QUERY;
+function update(url, params) {
+ if (!url)
return;
+
+ url[context].query = params.toString();
+}
+
+function getSearchParamPairs(target) {
+ const obj = target[searchParams];
+ const keys = Object.keys(obj);
+ const values = [];
+ for (var i = 0; i < keys.length; i++) {
+ const name = keys[i];
+ const value = obj[name];
+ if (Array.isArray(value)) {
+ for (const item of value)
+ values.push([name, item]);
+ } else {
+ values.push([name, value]);
+ }
}
- if (search[0] === '?') search = search.slice(1);
- url[context].query = '';
- binding.parse(search,
- binding.kQuery,
- null,
- url[context],
- (flags, protocol, username, password,
- host, port, path, query, fragment) => {
- if (flags & binding.URL_FLAGS_FAILED)
- return;
- if (query) {
- url[context].query = query;
- url[context].flags |= binding.URL_FLAGS_HAS_QUERY;
- } else {
- url[context].flags &= ~binding.URL_FLAGS_HAS_QUERY;
- }
- });
+ return values;
}
class URLSearchParams {
- constructor(url) {
- this[context] = url;
- this[searchParams] = querystring.parse(url[context].search || '');
+ constructor(init = '') {
+ if (init instanceof URLSearchParams) {
+ const childParams = init[searchParams];
+ this[searchParams] = Object.assign(Object.create(null), childParams);
+ } else {
+ init = String(init);
+ if (init[0] === '?') init = init.slice(1);
+ this[searchParams] = querystring.parse(init);
+ }
+
+ // "associated url object"
+ this[context] = null;
+
+ // Class string for an instance of URLSearchParams. This is different from
+ // the class string of the prototype object (set below).
+ Object.defineProperty(this, Symbol.toStringTag, {
+ value: 'URLSearchParams',
+ writable: false,
+ enumerable: false,
+ configurable: true
+ });
}
append(name, value) {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+ if (arguments.length < 2) {
+ throw new TypeError(
+ 'Both `name` and `value` arguments need to be specified');
+ }
+
const obj = this[searchParams];
name = String(name);
value = String(value);
var existing = obj[name];
- if (!existing) {
+ if (existing === undefined) {
obj[name] = value;
} else if (Array.isArray(existing)) {
existing.push(value);
} else {
obj[name] = [existing, value];
}
- update(this[context], querystring.stringify(obj));
+ update(this[context], this);
}
delete(name) {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+ if (arguments.length < 1) {
+ throw new TypeError('The `name` argument needs to be specified');
+ }
+
const obj = this[searchParams];
name = String(name);
delete obj[name];
- update(this[context], querystring.stringify(obj));
+ update(this[context], this);
}
set(name, value) {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+ if (arguments.length < 2) {
+ throw new TypeError(
+ 'Both `name` and `value` arguments need to be specified');
+ }
+
const obj = this[searchParams];
name = String(name);
value = String(value);
obj[name] = value;
- update(this[context], querystring.stringify(obj));
+ update(this[context], this);
}
get(name) {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+ if (arguments.length < 1) {
+ throw new TypeError('The `name` argument needs to be specified');
+ }
+
const obj = this[searchParams];
name = String(name);
var value = obj[name];
- return Array.isArray(value) ? value[0] : value;
+ return value === undefined ? null : Array.isArray(value) ? value[0] : value;
}
getAll(name) {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+ if (arguments.length < 1) {
+ throw new TypeError('The `name` argument needs to be specified');
+ }
+
const obj = this[searchParams];
name = String(name);
var value = obj[name];
@@ -561,32 +652,147 @@ class URLSearchParams {
}
has(name) {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+ if (arguments.length < 1) {
+ throw new TypeError('The `name` argument needs to be specified');
+ }
+
const obj = this[searchParams];
name = String(name);
return name in obj;
}
- *[Symbol.iterator]() {
- const obj = this[searchParams];
- for (const name in obj) {
- const value = obj[name];
- if (Array.isArray(value)) {
- for (const item of value)
- yield [name, item];
- } else {
- yield [name, value];
- }
+ // https://heycam.github.io/webidl/#es-iterators
+ // Define entries here rather than [Symbol.iterator] as the function name
+ // must be set to `entries`.
+ entries() {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+
+ return createSearchParamsIterator(this, 'key+value');
+ }
+
+ forEach(callback, thisArg = undefined) {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+ if (arguments.length < 1) {
+ throw new TypeError('The `callback` argument needs to be specified');
+ }
+
+ let pairs = getSearchParamPairs(this);
+
+ var i = 0;
+ while (i < pairs.length) {
+ const [key, value] = pairs[i];
+ callback.call(thisArg, value, key, this);
+ pairs = getSearchParamPairs(this);
+ i++;
}
}
+ // https://heycam.github.io/webidl/#es-iterable
+ keys() {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+
+ return createSearchParamsIterator(this, 'key');
+ }
+
+ values() {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+
+ return createSearchParamsIterator(this, 'value');
+ }
+
+ // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
toString() {
+ if (!this || !(this instanceof URLSearchParams)) {
+ throw new TypeError('Value of `this` is not a URLSearchParams');
+ }
+
return querystring.stringify(this[searchParams]);
}
}
+// https://heycam.github.io/webidl/#es-iterable-entries
+URLSearchParams.prototype[Symbol.iterator] = URLSearchParams.prototype.entries;
+Object.defineProperty(URLSearchParams.prototype, Symbol.toStringTag, {
+ value: 'URLSearchParamsPrototype',
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
+
+// https://heycam.github.io/webidl/#dfn-default-iterator-object
+function createSearchParamsIterator(target, kind) {
+ const iterator = Object.create(URLSearchParamsIteratorPrototype);
+ iterator[context] = {
+ target,
+ kind,
+ index: 0
+ };
+ return iterator;
+}
+
+// https://heycam.github.io/webidl/#dfn-iterator-prototype-object
+const URLSearchParamsIteratorPrototype = Object.setPrototypeOf({
+ next() {
+ if (!this ||
+ Object.getPrototypeOf(this) !== URLSearchParamsIteratorPrototype) {
+ throw new TypeError('Value of `this` is not a URLSearchParamsIterator');
+ }
+
+ const {
+ target,
+ kind,
+ index
+ } = this[context];
+ const values = getSearchParamPairs(target);
+ const len = values.length;
+ if (index >= len) {
+ return {
+ value: undefined,
+ done: true
+ };
+ }
+
+ const pair = values[index];
+ this[context].index = index + 1;
+
+ let result;
+ if (kind === 'key') {
+ result = pair[0];
+ } else if (kind === 'value') {
+ result = pair[1];
+ } else {
+ result = pair;
+ }
+
+ return {
+ value: result,
+ done: false
+ };
+ }
+}, IteratorPrototype);
+
+// Unlike interface and its prototype object, both default iterator object and
+// iterator prototype object of an interface have the same class string.
+Object.defineProperty(URLSearchParamsIteratorPrototype, Symbol.toStringTag, {
+ value: 'URLSearchParamsIterator',
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
-URL.originFor = function(url) {
+URL.originFor = function(url, base) {
if (!(url instanceof URL))
- url = new URL(url);
+ url = new URL(url, base);
var origin;
const protocol = url.protocol;
switch (protocol) {
diff --git a/lib/timers.js b/lib/timers.js
index 56af3a92d6bfe2..6d456da36faf67 100644
--- a/lib/timers.js
+++ b/lib/timers.js
@@ -473,8 +473,8 @@ function unrefdHandle() {
// Make sure we clean up if the callback is no longer a function
// even if the timer is an interval.
- if (!this.owner._repeat
- || typeof this.owner._onTimeout !== 'function') {
+ if (!this.owner._repeat ||
+ typeof this.owner._onTimeout !== 'function') {
this.owner.close();
}
}
@@ -580,8 +580,10 @@ function processImmediate() {
while (immediate) {
domain = immediate.domain;
- if (!immediate._onImmediate)
+ if (!immediate._onImmediate) {
+ immediate = immediate._idleNext;
continue;
+ }
if (domain)
domain.enter();
diff --git a/lib/url.js b/lib/url.js
index 03a9fb03dfcca7..75f4967ad2b6d3 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -42,6 +42,7 @@ function Url() {
// compiled once on the first module load.
const protocolPattern = /^([a-z0-9.+-]+:)/i;
const portPattern = /:[0-9]*$/;
+const hostPattern = /^\/\/[^@/]+@[^@/]+/;
// Special case for a simple path URL
const simplePathPattern = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/;
@@ -204,7 +205,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
// user@server is *always* interpreted as a hostname, and url
// resolution will treat //foo/bar as host=foo,path=bar because that's
// how the browser resolves relative URLs.
- if (slashesDenoteHost || proto || /^\/\/[^@/]+@[^@/]+/.test(rest)) {
+ if (slashesDenoteHost || proto || hostPattern.test(rest)) {
var slashes = rest.charCodeAt(0) === 47/*/*/ &&
rest.charCodeAt(1) === 47/*/*/;
if (slashes && !(proto && hostlessProtocol[proto])) {
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
index fd7968ff68ced1..ec713942f50e7e 100644
--- a/src/inspector_agent.cc
+++ b/src/inspector_agent.cc
@@ -548,10 +548,12 @@ bool AgentImpl::IsStarted() {
}
void AgentImpl::WaitForDisconnect() {
- shutting_down_ = true;
- fprintf(stderr, "Waiting for the debugger to disconnect...\n");
- fflush(stderr);
- inspector_->runMessageLoopOnPause(0);
+ if (state_ == State::kConnected) {
+ shutting_down_ = true;
+ fprintf(stderr, "Waiting for the debugger to disconnect...\n");
+ fflush(stderr);
+ inspector_->runMessageLoopOnPause(0);
+ }
}
#define READONLY_PROPERTY(obj, str, var) \
diff --git a/src/node.cc b/src/node.cc
index b33bc0d2a1782a..bdae47ee6c8211 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -2563,6 +2563,33 @@ void ClearFatalExceptionHandlers(Environment* env) {
Undefined(env->isolate())).FromJust();
}
+// Call process.emitWarning(str), fmt is a snprintf() format string
+void ProcessEmitWarning(Environment* env, const char* fmt, ...) {
+ char warning[1024];
+ va_list ap;
+
+ va_start(ap, fmt);
+ vsnprintf(warning, sizeof(warning), fmt, ap);
+ va_end(ap);
+
+ HandleScope handle_scope(env->isolate());
+ Context::Scope context_scope(env->context());
+
+ Local