From 5e7c8da2ea999592ae876a05680045687764c46a Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 7 Jun 2017 15:53:04 -0700 Subject: [PATCH 01/51] Working on 8.1.1 PR-URL: https://github.com/nodejs/node/pull/13483 --- src/node_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_version.h b/src/node_version.h index fff504e4b10..92814947143 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -24,9 +24,9 @@ #define NODE_MAJOR_VERSION 8 #define NODE_MINOR_VERSION 1 -#define NODE_PATCH_VERSION 0 +#define NODE_PATCH_VERSION 1 -#define NODE_VERSION_IS_RELEASE 1 +#define NODE_VERSION_IS_RELEASE 0 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) From 2778256680d92919b23634968fe4f30f53f87d53 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 2 Jun 2017 15:38:31 -0700 Subject: [PATCH 02/51] doc: remove note highlighting in GOVERNANCE doc Incorporate note into main text. PR-URL: https://github.com/nodejs/node/pull/13420 Reviewed-By: Anna Henningsen Reviewed-By: Gibson Fahnestock Reviewed-By: Luigi Pinca --- GOVERNANCE.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 417c16e04e7..6f1a5ccae10 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -24,10 +24,9 @@ maintained by the CTC and additional Collaborators who are added by the CTC on an ongoing basis. Individuals identified by the CTC as making significant and valuable -contributions are made Collaborators and given commit access to the project. - -_Note:_ If you make a significant contribution and are not considered -for commit access, log an issue or contact a CTC member directly. +contributions are made Collaborators and given commit access to the project. If +you make a significant contribution and are not considered for commit access, +log an issue or contact a CTC member directly. Modifications of the contents of the nodejs/node repository are made on a collaborative basis. Anybody with a GitHub account may propose a From a9be8fff58cef400a2401d0c03726306173ee730 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 2 Jun 2017 15:49:25 -0700 Subject: [PATCH 03/51] doc: minimal documentation for Emeritus status Include a high-level explanation of how Collaborators are identified for Emeritus status. This is intended to supply the minimum amount of information to being assigning Emeritus status to inactive Collaborators. The documentation may be expanded subsequently. PR-URL: https://github.com/nodejs/node/pull/13421 Reviewed-By: Gibson Fahnestock Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani --- GOVERNANCE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 6f1a5ccae10..a9fc9861f49 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -67,9 +67,9 @@ Typical activities of a Collaborator include: * participation in working groups * merging pull requests -While the above are typical things done by Collaborators, there are no required -activities to retain Collaborator status. There is currently no process by which -inactive Collaborators are removed from the project. +The CTC periodically reviews the Collaborator list to identify inactive +Collaborators. Past Collaborators are typically given _Emeritus_ status. Emeriti +may request that the CTC restore them to active status. ## CTC Membership From 3d12e1b4557427e3af30ef108ba4a4bc122b24fa Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 2 Jun 2017 16:27:54 -0700 Subject: [PATCH 04/51] doc: emphasize Collaborators in GOVERNANCE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Put information about Collaborators in GOVERNANCE.md before information about the CTC. For most things, the CTC is the last place to go, not the first and Collaborators have a lot of decision-making power in the project. The governance doc should reflect that. PR-URL: https://github.com/nodejs/node/pull/13423 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Michael Dawson Reviewed-By: Michaël Zasso Reviewed-By: Evan Lucas --- GOVERNANCE.md | 53 ++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/GOVERNANCE.md b/GOVERNANCE.md index a9fc9861f49..d7d60671ac1 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -1,27 +1,12 @@ # Node.js Project Governance -## Core Technical Committee - -The Node.js project is governed by a Core Technical Committee (CTC) which is -responsible for high-level guidance of the project. - -The CTC has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of CTC members, see the project -[README.md](./README.md#current-project-team-members). +The Node.js project is governed by its Collaborators, including a Core Technical +Committee (CTC) which is responsible for high-level guidance of the project. ## Collaborators The [nodejs/node](https://github.com/nodejs/node) GitHub repository is -maintained by the CTC and additional Collaborators who are added by the -CTC on an ongoing basis. +maintained by Collaborators who are added by the CTC on an ongoing basis. Individuals identified by the CTC as making significant and valuable contributions are made Collaborators and given commit access to the project. If @@ -44,18 +29,15 @@ be accepted unless: the change. Previously-objecting Collaborators do not necessarily have to sign-off on the change, but they should not be opposed to it. * The change is escalated to the CTC and the CTC votes to approve the change. - This should be used only after other options (especially discussion among - the disagreeing Collaborators) have been exhausted. + This should only happen if disagreements between Collaborators cannot be + resolved through discussion. Collaborators may opt to elevate significant or controversial modifications to the CTC by assigning the `ctc-review` label to a pull request or issue. The CTC should serve as the final arbiter where required. -For the current list of Collaborators, see the project -[README.md](./README.md#current-project-team-members). - -A guide for Collaborators is maintained in -[COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md). +* [Current list of Collaborators](./README.md#current-project-team-members) +* [A guide for Collaborators](./COLLABORATOR_GUIDE.md) ### Collaborator Activities @@ -71,6 +53,20 @@ The CTC periodically reviews the Collaborator list to identify inactive Collaborators. Past Collaborators are typically given _Emeritus_ status. Emeriti may request that the CTC restore them to active status. +## Core Technical Committee + +The Core Technical Committee (CTC) has final authority over this project +including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +* [Current list of CTC members](./README.md#current-project-team-members) + ## CTC Membership CTC seats are not time-limited. There is no fixed size of the CTC. The CTC @@ -82,9 +78,10 @@ membership beyond these rules. The CTC may add additional members to the CTC by a standard CTC motion. -When a CTC member's participation in [CTC activities](#ctc-activities) has become -minimal for a sustained period of time, the CTC will request that the member -either indicate an intention to increase participation or voluntarily resign. +When a CTC member's participation in [CTC activities](#ctc-activities) has +become minimal for a sustained period of time, the CTC will request that the +member either indicate an intention to increase participation or voluntarily +resign. CTC members may only be removed by voluntary resignation or through a standard CTC motion. From 216cb3f6e92b65876ad8e7f11c7cce2f8d87b3c4 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Sun, 4 Jun 2017 14:25:44 -0400 Subject: [PATCH 05/51] test,benchmark: stabilize child-process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit also some cleanup PR-URL: https://github.com/nodejs/node/pull/13457 Refs: https://github.com/nodejs/node/issues/12817 Reviewed-By: Tobias Nießen --- .../child-process-exec-stdout.js | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index a30eb92f6ad..dcd352cfcf6 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -1,41 +1,42 @@ 'use strict'; const common = require('../common.js'); +const { exec, execSync } = require('child_process'); +const isWindows = process.platform === 'win32'; var messagesLength = [64, 256, 1024, 4096]; -// Windows does not support that long arguments -if (process.platform !== 'win32') - messagesLength.push(32768); -const bench = common.createBenchmark(main, { +// Windows does not support command lines longer than 8191 characters +if (!isWindows) messagesLength.push(32768); + +const bench = common.createBenchmark(childProcessExecStdout, { len: messagesLength, dur: [5] }); -const child_process = require('child_process'); -const exec = child_process.exec; -function main(conf) { +function childProcessExecStdout(conf) { bench.start(); - const dur = +conf.dur; + const maxDuration = conf.dur * 1000; const len = +conf.len; - const msg = `"${'.'.repeat(len)}"`; - // eslint-disable-next-line no-unescaped-regexp-dot - msg.match(/./); - const options = {'stdio': ['ignore', 'pipe', 'ignore']}; - const child = exec(`yes ${msg}`, options); + const cmd = `yes "${'.'.repeat(len)}"`; + const child = exec(cmd, { 'stdio': ['ignore', 'pipe', 'ignore'] }); var bytes = 0; - child.stdout.on('data', function(msg) { + child.stdout.on('data', (msg) => { bytes += msg.length; }); - setTimeout(function() { + setTimeout(() => { bench.end(bytes); - if (process.platform === 'win32') { - // Sometimes there's a yes.exe process left hanging around on Windows... - child_process.execSync(`taskkill /f /t /pid ${child.pid}`); + if (isWindows) { + // Sometimes there's a yes.exe process left hanging around on Windows. + try { + execSync(`taskkill /f /t /pid ${child.pid}`); + } catch (_) { + // this is a best effort kill. stderr is piped to parent for tracing. + } } else { child.kill(); } - }, dur * 1000); + }, maxDuration); } From fe5ea3feb0c5ad027865369e92d7fddef1318509 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 4 Jun 2017 11:19:05 -0700 Subject: [PATCH 06/51] test: check callback not invoked on lookup error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use `common.mustNotCall()` to confirm that callback is not invoked when `dns.lookup()` throws. PR-URL: https://github.com/nodejs/node/pull/13456 Reviewed-By: Tobias Nießen Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Gibson Fahnestock --- test/parallel/test-dns-lookup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-dns-lookup.js b/test/parallel/test-dns-lookup.js index 9f56f21481d..a1fad873e33 100644 --- a/test/parallel/test-dns-lookup.js +++ b/test/parallel/test-dns-lookup.js @@ -24,7 +24,7 @@ assert.throws(() => { hints: 100, family: 0, all: false - }, common.noop); + }, common.mustNotCall()); }, /^TypeError: Invalid argument: hints must use valid flags$/); assert.throws(() => { @@ -32,7 +32,7 @@ assert.throws(() => { hints: 0, family: 20, all: false - }, common.noop); + }, common.mustNotCall()); }, /^TypeError: Invalid argument: family must be 4 or 6$/); assert.doesNotThrow(() => { From ad07c46b004264c6a6a1b4719a1d6d0563393f86 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 5 Jun 2017 11:22:26 -0700 Subject: [PATCH 07/51] test: refactor domain tests * Check that noop callback is or isn't invoked as appropriate using common.mustCall() and common.mustNotCall() * Fix typo in array literal PR-URL: https://github.com/nodejs/node/pull/13480 Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Michael Dawson --- test/parallel/test-domain-crypto.js | 6 +++--- test/parallel/test-domain-timers.js | 2 +- test/parallel/test-domain.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js index acc90a4a486..d0bdbf4720b 100644 --- a/test/parallel/test-domain-crypto.js +++ b/test/parallel/test-domain-crypto.js @@ -37,9 +37,9 @@ global.domain = require('domain'); // should not throw a 'TypeError: undefined is not a function' exception crypto.randomBytes(8); -crypto.randomBytes(8, common.noop); +crypto.randomBytes(8, common.mustCall()); const buf = Buffer.alloc(8); crypto.randomFillSync(buf); crypto.pseudoRandomBytes(8); -crypto.pseudoRandomBytes(8, common.noop); -crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.noop); +crypto.pseudoRandomBytes(8, common.mustCall()); +crypto.pbkdf2('password', 'salt', 8, 8, 'sha1', common.mustCall()); diff --git a/test/parallel/test-domain-timers.js b/test/parallel/test-domain-timers.js index 888b452cb99..fe7247b2a92 100644 --- a/test/parallel/test-domain-timers.js +++ b/test/parallel/test-domain-timers.js @@ -51,4 +51,4 @@ immediated.run(function() { }); }); -const timeout = setTimeout(common.noop, 10 * 1000); +const timeout = setTimeout(common.mustNotCall(), 10 * 1000); diff --git a/test/parallel/test-domain.js b/test/parallel/test-domain.js index 1b6e1c7bbf4..6cef4e52936 100644 --- a/test/parallel/test-domain.js +++ b/test/parallel/test-domain.js @@ -22,7 +22,7 @@ 'use strict'; // Simple tests of most basic domain functionality. -const common = require('../common'); +require('../common'); const assert = require('assert'); const domain = require('domain'); const events = require('events'); @@ -259,7 +259,7 @@ const fst = fs.createReadStream('stream for nonexistent file'); d.add(fst); expectCaught++; -[42, null, , false, common.noop, 'string'].forEach(function(something) { +[42, null, undefined, false, () => {}, 'string'].forEach(function(something) { const d = new domain.Domain(); d.run(function() { process.nextTick(function() { From dd158b096f2b5b0d080ea3e16ca9d8a87d8e2792 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 5 Jun 2017 13:56:21 +0200 Subject: [PATCH 08/51] src: make IsConstructCall checks consistent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The most common way to perfom this check is by using the simple CHECK macro. This commit suggest making this consistent in favour of the most commonly used. PR-URL: https://github.com/nodejs/node/pull/13473 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Michael Dawson Reviewed-By: Michaël Zasso --- src/node_crypto.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 8c212168760..fbd3e9fe1c8 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3323,7 +3323,7 @@ void CipherBase::Initialize(Environment* env, Local target) { void CipherBase::New(const FunctionCallbackInfo& args) { - CHECK_EQ(args.IsConstructCall(), true); + CHECK(args.IsConstructCall()); CipherKind kind = args[0]->IsTrue() ? kCipher : kDecipher; Environment* env = Environment::GetCurrent(args); new CipherBase(env, args.This(), kind); From 8c5407d321e95d3c2acb56c7449be20f295497e3 Mon Sep 17 00:00:00 2001 From: Tarun Date: Thu, 8 Jun 2017 03:00:35 +0530 Subject: [PATCH 09/51] doc: corrects reference to tlsClientError After the renaming of `clientError` in TLS to `tlsClientError` in https://github.com/nodejs/node/commit/1ab6b21360d97719b3101153fb164c0c3eddf08, the docs inconsistently referred the error as `clientError`, which is now corrected. Fixes: https://github.com/nodejs/node/issues/13417 PR-URL: https://github.com/nodejs/node/pull/13533 Reviewed-By: Refael Ackermann Reviewed-By: Roman Reiss --- doc/api/tls.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/tls.md b/doc/api/tls.md index 6229c7a79fa..94db2dea67b 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1025,8 +1025,8 @@ changes: * `options` {Object} * `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. + seconds. A `'tlsClientError'` is emitted on the `tls.Server` object whenever + a handshake times out. * `requestCert` {boolean} If `true` the server will request a certificate from clients that connect and attempt to verify that certificate. Defaults to `false`. From 85cac4ed53ec9d30f4c62264180e7e0c64739bd4 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Wed, 7 Jun 2017 18:14:50 -0400 Subject: [PATCH 10/51] doc: update new CTC members MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref: https://github.com/nodejs/node/issues/12789 Ref: https://github.com/nodejs/node/issues/12790 PR-URL: https://github.com/nodejs/node/pull/13534 Reviewed-By: Matteo Collina Reviewed-By: Evan Lucas Reviewed-By: Rich Trott Reviewed-By: Jeremiah Senkpiel Reviewed-By: Joyee Cheung Reviewed-By: Tobias Nießen --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e014085c69e..1c93a5f2ede 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,10 @@ more information about the governance of the Node.js project, see **Fedor Indutny** <fedor.indutny@gmail.com> * [jasnell](https://github.com/jasnell) - **James M Snell** <jasnell@gmail.com> (he/him) +* [joyeecheung](https://github.com/joyeecheung) - +**Joyee Cheung** <joyeec9h3@gmail.com> (she/her) +* [mcollina](https://github.com/mcollina) - +**Matteo Collina** <matteo.collina@gmail.com> (he/him) * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <michael_dawson@ca.ibm.com> (he/him) * [misterdjules](https://github.com/misterdjules) - @@ -301,8 +305,6 @@ more information about the governance of the Node.js project, see **João Reis** <reis@janeasystems.com> * [joshgav](https://github.com/joshgav) - **Josh Gavant** <josh.gavant@outlook.com> -* [joyeecheung](https://github.com/joyeecheung) - -**Joyee Cheung** <joyeec9h3@gmail.com> (she/her) * [julianduque](https://github.com/julianduque) - **Julian Duque** <julianduquej@gmail.com> (he/him) * [JungMinu](https://github.com/JungMinu) - @@ -319,8 +321,6 @@ more information about the governance of the Node.js project, see **Aleksey Smolenchuk** <lxe@lxe.co> * [matthewloring](https://github.com/matthewloring) - **Matthew Loring** <mattloring@google.com> -* [mcollina](https://github.com/mcollina) - -**Matteo Collina** <matteo.collina@gmail.com> (he/him) * [micnic](https://github.com/micnic) - **Nicu Micleușanu** <micnic90@gmail.com> (he/him) * [mikeal](https://github.com/mikeal) - From bf61d977423c3c39dd2b37a97f71f63983d4aa0e Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 2 Jun 2017 23:49:55 +0200 Subject: [PATCH 11/51] async_hooks: make sure `.{en|dis}able() === this` Make sure that `hook.enable()` and `hook.disable()` return `hook` consistently, as the documentation indicates. PR-URL: https://github.com/nodejs/node/pull/13418 Reviewed-By: Refael Ackermann Reviewed-By: Andreas Madsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Trevor Norris --- lib/async_hooks.js | 4 ++-- .../test-async-hooks-enable-disable.js | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-async-hooks-enable-disable.js diff --git a/lib/async_hooks.js b/lib/async_hooks.js index aec73ed770f..d343a0e3de3 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -96,7 +96,7 @@ class AsyncHook { // Each hook is only allowed to be added once. if (hooks_array.includes(this)) - return; + return this; if (!setupHooksCalled) { setupHooksCalled = true; @@ -124,7 +124,7 @@ class AsyncHook { const index = hooks_array.indexOf(this); if (index === -1) - return; + return this; hook_fields[kInit] -= +!!this[init_symbol]; hook_fields[kBefore] -= +!!this[before_symbol]; diff --git a/test/parallel/test-async-hooks-enable-disable.js b/test/parallel/test-async-hooks-enable-disable.js new file mode 100644 index 00000000000..b685c712345 --- /dev/null +++ b/test/parallel/test-async-hooks-enable-disable.js @@ -0,0 +1,20 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const async_hooks = require('async_hooks'); + +const hook = async_hooks.createHook({ + init: common.mustCall(() => {}, 1), + before: common.mustNotCall(), + after: common.mustNotCall(), + destroy: common.mustNotCall() +}); + +assert.strictEqual(hook.enable(), hook); +assert.strictEqual(hook.enable(), hook); + +setImmediate(common.mustCall()); + +assert.strictEqual(hook.disable(), hook); +assert.strictEqual(hook.disable(), hook); +assert.strictEqual(hook.disable(), hook); From c8db0475e0321677f5686056b1d481458b8b0ae4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 6 Jun 2017 09:53:32 -0700 Subject: [PATCH 12/51] test: refactor test-fs-read-* * Use `common.mustNotCall()` in place of `common.noop` where appropriate * Increase specificity of regular expressions (that is, make them match the whole error string rather than part of the error string) in `assert.throws()` calls PR-URL: https://github.com/nodejs/node/pull/13501 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Michael Dawson --- test/parallel/test-fs-read-file-assert-encoding.js | 4 ++-- test/parallel/test-fs-read-type.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-fs-read-file-assert-encoding.js b/test/parallel/test-fs-read-file-assert-encoding.js index 929caf88bd4..ac0f45f98b3 100644 --- a/test/parallel/test-fs-read-file-assert-encoding.js +++ b/test/parallel/test-fs-read-file-assert-encoding.js @@ -8,6 +8,6 @@ const encoding = 'foo-8'; const filename = 'bar.txt'; assert.throws( - fs.readFile.bind(fs, filename, { encoding }, common.noop), - new RegExp(`Error: Unknown encoding: ${encoding}$`) + fs.readFile.bind(fs, filename, { encoding }, common.mustNotCall()), + new RegExp(`^Error: Unknown encoding: ${encoding}$`) ); diff --git a/test/parallel/test-fs-read-type.js b/test/parallel/test-fs-read-type.js index e62405c48ee..c6e3e53f054 100644 --- a/test/parallel/test-fs-read-type.js +++ b/test/parallel/test-fs-read-type.js @@ -13,9 +13,9 @@ assert.throws(() => { expected.length, 0, 'utf-8', - common.noop); -}, /Second argument needs to be a buffer/); + common.mustNotCall()); +}, /^TypeError: Second argument needs to be a buffer$/); assert.throws(() => { fs.readSync(fd, expected.length, 0, 'utf-8'); -}, /Second argument needs to be a buffer/); +}, /^TypeError: Second argument needs to be a buffer$/); From 61c73085babfb1e1999b1bcb79eb16e8a92ec8df Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 3 Jun 2017 00:08:23 +0200 Subject: [PATCH 13/51] async_hooks: minor refactor to callback invocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-use the `init` function wherever possible, and move `try { … } catch` blocks that result in fatal errors to a larger scope. Also make the argument order for `init()` consistent in the codebase. PR-URL: https://github.com/nodejs/node/pull/13419 Reviewed-By: Trevor Norris Reviewed-By: Andreas Madsen Reviewed-By: Refael Ackermann --- lib/async_hooks.js | 103 ++++++++++++++++++--------------------------- src/async-wrap.cc | 2 +- 2 files changed, 42 insertions(+), 63 deletions(-) diff --git a/lib/async_hooks.js b/lib/async_hooks.js index d343a0e3de3..1726a4f7e1d 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -214,17 +214,7 @@ class AsyncResource { if (async_hook_fields[kInit] === 0) return; - processing_hook = true; - for (var i = 0; i < active_hooks_array.length; i++) { - if (typeof active_hooks_array[i][init_symbol] === 'function') { - runInitCallback(active_hooks_array[i][init_symbol], - this[async_id_symbol], - type, - triggerId, - this); - } - } - processing_hook = false; + init(this[async_id_symbol], type, triggerId, this); } emitBefore() { @@ -321,14 +311,7 @@ function emitInitS(asyncId, type, triggerId, resource) { if (!Number.isSafeInteger(triggerId) || triggerId < 0) throw new RangeError('triggerId must be an unsigned integer'); - processing_hook = true; - for (var i = 0; i < active_hooks_array.length; i++) { - if (typeof active_hooks_array[i][init_symbol] === 'function') { - runInitCallback( - active_hooks_array[i][init_symbol], asyncId, type, triggerId, resource); - } - } - processing_hook = false; + init(asyncId, type, triggerId, resource); // Isn't null if hooks were added/removed while the hooks were running. if (tmp_active_hooks_array !== null) { @@ -339,10 +322,15 @@ function emitInitS(asyncId, type, triggerId, resource) { function emitBeforeN(asyncId) { processing_hook = true; - for (var i = 0; i < active_hooks_array.length; i++) { - if (typeof active_hooks_array[i][before_symbol] === 'function') { - runCallback(active_hooks_array[i][before_symbol], asyncId); + // Use a single try/catch for all hook to avoid setting up one per iteration. + try { + for (var i = 0; i < active_hooks_array.length; i++) { + if (typeof active_hooks_array[i][before_symbol] === 'function') { + active_hooks_array[i][before_symbol](asyncId); + } } + } catch (e) { + fatalError(e); } processing_hook = false; @@ -366,10 +354,8 @@ function emitBeforeS(asyncId, triggerId = asyncId) { pushAsyncIds(asyncId, triggerId); - if (async_hook_fields[kBefore] === 0) { + if (async_hook_fields[kBefore] === 0) return; - } - emitBeforeN(asyncId); } @@ -377,15 +363,18 @@ function emitBeforeS(asyncId, triggerId = asyncId) { // Called from native. The asyncId stack handling is taken care of there before // this is called. function emitAfterN(asyncId) { - if (async_hook_fields[kAfter] > 0) { - processing_hook = true; + processing_hook = true; + // Use a single try/catch for all hook to avoid setting up one per iteration. + try { for (var i = 0; i < active_hooks_array.length; i++) { if (typeof active_hooks_array[i][after_symbol] === 'function') { - runCallback(active_hooks_array[i][after_symbol], asyncId); + active_hooks_array[i][after_symbol](asyncId); } } - processing_hook = false; + } catch (e) { + fatalError(e); } + processing_hook = false; if (tmp_active_hooks_array !== null) { restoreTmpHooks(); @@ -397,7 +386,9 @@ function emitAfterN(asyncId) { // kIdStackIndex. But what happens if the user doesn't have both before and // after callbacks. function emitAfterS(asyncId) { - emitAfterN(asyncId); + if (async_hook_fields[kAfter] > 0) + emitAfterN(asyncId); + popAsyncIds(asyncId); } @@ -413,10 +404,15 @@ function emitDestroyS(asyncId) { function emitDestroyN(asyncId) { processing_hook = true; - for (var i = 0; i < active_hooks_array.length; i++) { - if (typeof active_hooks_array[i][destroy_symbol] === 'function') { - runCallback(active_hooks_array[i][destroy_symbol], asyncId); + // Use a single try/catch for all hook to avoid setting up one per iteration. + try { + for (var i = 0; i < active_hooks_array.length; i++) { + if (typeof active_hooks_array[i][destroy_symbol] === 'function') { + active_hooks_array[i][destroy_symbol](asyncId); + } } + } catch (e) { + fatalError(e); } processing_hook = false; @@ -434,41 +430,24 @@ function emitDestroyN(asyncId) { // init(). // TODO(trevnorris): Perhaps have MakeCallback call a single JS function that // does the before/callback/after calls to remove two additional calls to JS. -function init(asyncId, type, resource, triggerId) { - processing_hook = true; - for (var i = 0; i < active_hooks_array.length; i++) { - if (typeof active_hooks_array[i][init_symbol] === 'function') { - runInitCallback( - active_hooks_array[i][init_symbol], asyncId, type, triggerId, resource); - } - } - processing_hook = false; -} - - -// Generalized callers for all callbacks that handles error handling. -// If either runInitCallback() or runCallback() throw then force the -// application to shutdown if one of the callbacks throws. This may change in -// the future depending on whether it can be determined if there's a slim -// chance of the application remaining stable after handling one of these +// Force the application to shutdown if one of the callbacks throws. This may +// change in the future depending on whether it can be determined if there's a +// slim chance of the application remaining stable after handling one of these // exceptions. - -function runInitCallback(cb, asyncId, type, triggerId, resource) { - try { - cb(asyncId, type, triggerId, resource); - } catch (e) { - fatalError(e); - } -} - - -function runCallback(cb, asyncId) { +function init(asyncId, type, triggerId, resource) { + processing_hook = true; + // Use a single try/catch for all hook to avoid setting up one per iteration. try { - cb(asyncId); + for (var i = 0; i < active_hooks_array.length; i++) { + if (typeof active_hooks_array[i][init_symbol] === 'function') { + active_hooks_array[i][init_symbol](asyncId, type, triggerId, resource); + } + } } catch (e) { fatalError(e); } + processing_hook = false; } diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 0f5c800f40d..813d7c21bb0 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -560,8 +560,8 @@ void AsyncWrap::EmitAsyncInit(Environment* env, Local argv[] = { Number::New(env->isolate(), async_id), type, - object, Number::New(env->isolate(), trigger_id), + object, }; TryCatch try_catch(env->isolate()); From f134c9d1478dc01a83265778e3eee4024ad4dc86 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 8 Jun 2017 10:55:08 +0200 Subject: [PATCH 14/51] src: correct indentation for X509ToObject The indentation in one of the if statements blocks is four spaces instead of two. This commit changes the indentation to two spaces. PR-URL: https://github.com/nodejs/node/pull/13543 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson --- src/node_crypto.cc | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index fbd3e9fe1c8..579ba3c65da 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1581,26 +1581,26 @@ static Local X509ToObject(Environment* env, X509* cert) { rsa = EVP_PKEY_get1_RSA(pkey); if (rsa != nullptr) { - BN_print(bio, rsa->n); - BIO_get_mem_ptr(bio, &mem); - info->Set(env->modulus_string(), - String::NewFromUtf8(env->isolate(), mem->data, - String::kNormalString, mem->length)); - (void) BIO_reset(bio); - - uint64_t exponent_word = static_cast(BN_get_word(rsa->e)); - uint32_t lo = static_cast(exponent_word); - uint32_t hi = static_cast(exponent_word >> 32); - if (hi == 0) { - BIO_printf(bio, "0x%x", lo); - } else { - BIO_printf(bio, "0x%x%08x", hi, lo); - } - BIO_get_mem_ptr(bio, &mem); - info->Set(env->exponent_string(), - String::NewFromUtf8(env->isolate(), mem->data, - String::kNormalString, mem->length)); - (void) BIO_reset(bio); + BN_print(bio, rsa->n); + BIO_get_mem_ptr(bio, &mem); + info->Set(env->modulus_string(), + String::NewFromUtf8(env->isolate(), mem->data, + String::kNormalString, mem->length)); + (void) BIO_reset(bio); + + uint64_t exponent_word = static_cast(BN_get_word(rsa->e)); + uint32_t lo = static_cast(exponent_word); + uint32_t hi = static_cast(exponent_word >> 32); + if (hi == 0) { + BIO_printf(bio, "0x%x", lo); + } else { + BIO_printf(bio, "0x%x%08x", hi, lo); + } + BIO_get_mem_ptr(bio, &mem); + info->Set(env->exponent_string(), + String::NewFromUtf8(env->isolate(), mem->data, + String::kNormalString, mem->length)); + (void) BIO_reset(bio); } if (pkey != nullptr) { From d1fa59fbb7012f8edd37a37cd668b747664c018d Mon Sep 17 00:00:00 2001 From: Brian White Date: Sun, 4 Jun 2017 20:12:48 -0400 Subject: [PATCH 15/51] child_process: simplify send() result handling PR-URL: https://github.com/nodejs/node/pull/13459 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis --- lib/internal/child_process.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index abd4b16d120..68dd1145d32 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -645,16 +645,15 @@ function setupChannel(target, channel) { obj.postSend(handle, options, target); } - req.oncomplete = function() { - if (this.async === true) + if (req.async) { + req.oncomplete = function() { control.unref(); - if (typeof callback === 'function') - callback(null); - }; - if (req.async === true) { + if (typeof callback === 'function') + callback(null); + }; control.ref(); - } else { - process.nextTick(function() { req.oncomplete(); }); + } else if (typeof callback === 'function') { + process.nextTick(callback, null); } } else { // Cleanup handle on error From 0ca4bd1e18b50b90b626bccb2fbc6b023fd5a6d1 Mon Sep 17 00:00:00 2001 From: Brian White Date: Sun, 4 Jun 2017 20:15:14 -0400 Subject: [PATCH 16/51] child_process: reduce nextTick() usage PR-URL: https://github.com/nodejs/node/pull/13459 Reviewed-By: Refael Ackermann Reviewed-By: Ben Noordhuis --- benchmark/cluster/echo.js | 70 +++++++++++++++++++++++++++++++++++ lib/internal/child_process.js | 53 +++++++++++++++----------- 2 files changed, 102 insertions(+), 21 deletions(-) create mode 100644 benchmark/cluster/echo.js diff --git a/benchmark/cluster/echo.js b/benchmark/cluster/echo.js new file mode 100644 index 00000000000..0733bdbd207 --- /dev/null +++ b/benchmark/cluster/echo.js @@ -0,0 +1,70 @@ +'use strict'; + +const cluster = require('cluster'); +if (cluster.isMaster) { + const common = require('../common.js'); + const bench = common.createBenchmark(main, { + workers: [1], + payload: ['string', 'object'], + sendsPerBroadcast: [1, 10], + n: [1e5] + }); + + function main(conf) { + var n = +conf.n; + var workers = +conf.workers; + var sends = +conf.sendsPerBroadcast; + var expectedPerBroadcast = sends * workers; + var payload; + var readies = 0; + var broadcasts = 0; + var msgCount = 0; + + switch (conf.payload) { + case 'string': + payload = 'hello world!'; + break; + case 'object': + payload = { action: 'pewpewpew', powerLevel: 9001 }; + break; + default: + throw new Error('Unsupported payload type'); + } + + for (var i = 0; i < workers; ++i) + cluster.fork().on('online', onOnline).on('message', onMessage); + + function onOnline(msg) { + if (++readies === workers) { + bench.start(); + broadcast(); + } + } + + function broadcast() { + var id; + if (broadcasts++ === n) { + bench.end(n); + for (id in cluster.workers) + cluster.workers[id].disconnect(); + return; + } + for (id in cluster.workers) { + const worker = cluster.workers[id]; + for (var i = 0; i < sends; ++i) + worker.send(payload); + } + } + + function onMessage(msg) { + if (++msgCount === expectedPerBroadcast) { + msgCount = 0; + broadcast(); + } + } + } +} else { + process.on('message', function(msg) { + process.send(msg); + }); +} diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 68dd1145d32..25190277e2e 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -456,16 +456,22 @@ function setupChannel(target, channel) { } chunks[0] = jsonBuffer + chunks[0]; + var nextTick = false; for (var i = 0; i < numCompleteChunks; i++) { var message = JSON.parse(chunks[i]); // There will be at most one NODE_HANDLE message in every chunk we // read because SCM_RIGHTS messages don't get coalesced. Make sure // that we deliver the handle with the right message however. - if (message && message.cmd === 'NODE_HANDLE') - handleMessage(target, message, recvHandle); - else - handleMessage(target, message, undefined); + if (isInternal(message)) { + if (message.cmd === 'NODE_HANDLE') + handleMessage(message, recvHandle, true, false); + else + handleMessage(message, undefined, true, false); + } else { + handleMessage(message, undefined, false, nextTick); + nextTick = true; + } } jsonBuffer = incompleteChunk; this.buffering = jsonBuffer.length !== 0; @@ -526,7 +532,7 @@ function setupChannel(target, channel) { // Convert handle object obj.got.call(this, message, handle, function(handle) { - handleMessage(target, message.msg, handle); + handleMessage(message.msg, handle, isInternal(message.msg), false); }); }); @@ -732,27 +738,32 @@ function setupChannel(target, channel) { process.nextTick(finish); }; + function emit(event, message, handle) { + target.emit(event, message, handle); + } + + function handleMessage(message, handle, internal, nextTick) { + if (!target.channel) + return; + + var eventName = (internal ? 'internalMessage' : 'message'); + if (nextTick) + process.nextTick(emit, eventName, message, handle); + else + target.emit(eventName, message, handle); + } + channel.readStart(); return control; } - const INTERNAL_PREFIX = 'NODE_'; -function handleMessage(target, message, handle) { - if (!target.channel) - return; - - var eventName = 'message'; - if (message !== null && - typeof message === 'object' && - typeof message.cmd === 'string' && - message.cmd.length > INTERNAL_PREFIX.length && - message.cmd.slice(0, INTERNAL_PREFIX.length) === INTERNAL_PREFIX) { - eventName = 'internalMessage'; - } - process.nextTick(() => { - target.emit(eventName, message, handle); - }); +function isInternal(message) { + return (message !== null && + typeof message === 'object' && + typeof message.cmd === 'string' && + message.cmd.length > INTERNAL_PREFIX.length && + message.cmd.slice(0, INTERNAL_PREFIX.length) === INTERNAL_PREFIX); } function nop() { } From 6a696d15ff3830318e5ded688eb4e728eeccd14c Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Sun, 4 Jun 2017 20:15:27 +0300 Subject: [PATCH 17/51] inspector: fix crash on exception Fixes: https://github.com/nodejs/node/issues/13438 PR-URL: https://github.com/nodejs/node/pull/13455 Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Timothy Gu --- src/inspector_agent.cc | 4 +- test/inspector/test-inspector-exception.js | 64 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 test/inspector/test-inspector-exception.js diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 948719ed702..f1acfa64b4a 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -371,7 +371,9 @@ void CallAndPauseOnStart( v8::MaybeLocal retval = args[0].As()->Call(env->context(), args[1], call_args.size(), call_args.data()); - args.GetReturnValue().Set(retval.ToLocalChecked()); + if (!retval.IsEmpty()) { + args.GetReturnValue().Set(retval.ToLocalChecked()); + } } // Used in NodeInspectorClient::currentTimeMS() below. diff --git a/test/inspector/test-inspector-exception.js b/test/inspector/test-inspector-exception.js new file mode 100644 index 00000000000..3f470c94c18 --- /dev/null +++ b/test/inspector/test-inspector-exception.js @@ -0,0 +1,64 @@ +'use strict'; +const common = require('../common'); + +common.skipIfInspectorDisabled(); + +const assert = require('assert'); +const helper = require('./inspector-helper.js'); +const path = require('path'); + +const script = path.join(common.fixturesDir, 'throws_error.js'); + + +function setupExpectBreakOnLine(line, url, session) { + return function(message) { + if ('Debugger.paused' === message['method']) { + const callFrame = message['params']['callFrames'][0]; + const location = callFrame['location']; + assert.strictEqual(url, session.scriptUrlForId(location['scriptId'])); + assert.strictEqual(line, location['lineNumber']); + return true; + } + }; +} + +function testBreakpointOnStart(session) { + const commands = [ + { 'method': 'Runtime.enable' }, + { 'method': 'Debugger.enable' }, + { 'method': 'Debugger.setPauseOnExceptions', + 'params': {'state': 'none'} }, + { 'method': 'Debugger.setAsyncCallStackDepth', + 'params': {'maxDepth': 0} }, + { 'method': 'Profiler.enable' }, + { 'method': 'Profiler.setSamplingInterval', + 'params': {'interval': 100} }, + { 'method': 'Debugger.setBlackboxPatterns', + 'params': {'patterns': []} }, + { 'method': 'Runtime.runIfWaitingForDebugger' } + ]; + + session + .sendInspectorCommands(commands) + .expectMessages(setupExpectBreakOnLine(0, script, session)); +} + +function testWaitsForFrontendDisconnect(session, harness) { + console.log('[test]', 'Verify node waits for the frontend to disconnect'); + session.sendInspectorCommands({ 'method': 'Debugger.resume'}) + .expectStderrOutput('Waiting for the debugger to disconnect...') + .disconnect(true); +} + +function runTests(harness) { + harness + .runFrontendSession([ + testBreakpointOnStart, + testWaitsForFrontendDisconnect + ]).expectShutDown(1); +} + +helper.startNodeForInspectorTest(runTests, + undefined, + undefined, + script); From 98d7f251817673a8fcef0d89151e93551a90fc48 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 6 Jun 2017 15:27:16 -0400 Subject: [PATCH 18/51] doc: fix out of date sections in n-api doc PR-URL: https://github.com/nodejs/node/pull/13508 Fixes: https://github.com/nodejs/node/issues/13469 Fixes: https://github.com/nodejs/node/issues/13458 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Jason Ginchereau --- doc/api/n-api.md | 63 ++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 668e3fab18f..e0f29eb2fca 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -1560,25 +1560,6 @@ is passed in it returns `napi_number_expected`. This API returns the C int64 primitive equivalent of the given JavaScript Number -#### *napi_get_value_string_length* - -```C -napi_status napi_get_value_string_length(napi_env env, - napi_value value, - int* result) -``` - -- `[in] env`: The environment that the API is invoked under. -- `[in] value`: `napi_value` representing JavaScript string. -- `[out] result`: Number of characters in the given JavaScript string. - -Returns `napi_ok` if the API succeeded. If a non-String `napi_value` -is passed in it returns `napi_string_expected`. - -This API returns the number of characters in the given JavaScript string. - #### *napi_get_value_string_utf8* ```C -NODE_EXTERN napi_status napi_create_error(napi_env env, const char* msg); +NODE_EXTERN napi_status napi_create_error(napi_env env, + const char* msg, + napi_value* result); ``` - `[in] env`: The environment that the API is invoked under. - `[in] msg`: C string representing the text to be associated with. @@ -422,7 +424,9 @@ This API returns a JavaScript Error with the text provided. added: v8.0.0 --> ```C -NODE_EXTERN napi_status napi_create_type_error(napi_env env, const char* msg); +NODE_EXTERN napi_status napi_create_type_error(napi_env env, + const char* msg, + napi_value* result); ``` - `[in] env`: The environment that the API is invoked under. - `[in] msg`: C string representing the text to be associated with. @@ -438,7 +442,9 @@ This API returns a JavaScript TypeError with the text provided. added: v8.0.0 --> ```C -NODE_EXTERN napi_status napi_create_range_error(napi_env env, const char* msg); +NODE_EXTERN napi_status napi_create_range_error(napi_env env, + const char* msg, + napi_value* result); ``` - `[in] env`: The environment that the API is invoked under. - `[in] msg`: C string representing the text to be associated with. From 0df6c0b5f067806ddf821da7d3934472d8b21557 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 8 Jun 2017 23:13:11 +0200 Subject: [PATCH 32/51] Revert "readline: clean up event listener in onNewListener" This reverts commit 81ddeb98f6a0f7a5165cd6e3b87cdaa550fdf3ec. Ref: https://github.com/nodejs/node/pull/13266 PR-URL: https://github.com/nodejs/node/pull/13560 Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig --- lib/readline.js | 3 --- test/parallel/test-readline-set-raw-mode.js | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/readline.js b/lib/readline.js index 6a1ed150d72..60864f40afd 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -1039,9 +1039,6 @@ function emitKeypressEvents(stream, iface) { } else { stream.on('newListener', onNewListener); } - if (iface) { - iface.once('close', () => { stream.removeListener('data', onData); }); - } } /** diff --git a/test/parallel/test-readline-set-raw-mode.js b/test/parallel/test-readline-set-raw-mode.js index ddffd131d0b..db42a5a9495 100644 --- a/test/parallel/test-readline-set-raw-mode.js +++ b/test/parallel/test-readline-set-raw-mode.js @@ -74,8 +74,6 @@ assert(!rawModeCalled); assert(resumeCalled); assert(!pauseCalled); -// One data listener for the keypress events. -assert.strictEqual(stream.listeners('data').length, 1); // close() should call setRawMode(false) expectedRawMode = false; @@ -88,5 +86,5 @@ assert(!resumeCalled); assert(pauseCalled); assert.deepStrictEqual(stream.listeners('keypress'), []); -// Data listener is removed once interface is closed. -assert.strictEqual(stream.listeners('data').length, 0); +// one data listener for the keypress events. +assert.strictEqual(stream.listeners('data').length, 1); From 2ea529b7971f6a72efc40b2289ccde5a9dfa0783 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 8 Jun 2017 23:12:54 +0200 Subject: [PATCH 33/51] test: add regression test for 13557 Fixes: https://github.com/nodejs/node/issues/13557 PR-URL: https://github.com/nodejs/node/pull/13560 Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig --- test/parallel/test-readline-reopen.js | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/parallel/test-readline-reopen.js diff --git a/test/parallel/test-readline-reopen.js b/test/parallel/test-readline-reopen.js new file mode 100644 index 00000000000..dead22d81ac --- /dev/null +++ b/test/parallel/test-readline-reopen.js @@ -0,0 +1,44 @@ +'use strict'; + +// Regression test for https://github.com/nodejs/node/issues/13557 +// Tests that multiple subsequent readline instances can re-use an input stream. + +const common = require('../common'); +const assert = require('assert'); +const readline = require('readline'); +const { PassThrough } = require('stream'); + +const input = new PassThrough(); +const output = new PassThrough(); + +const rl1 = readline.createInterface({ + input, + output, + terminal: true +}); + +rl1.on('line', common.mustCall(rl1OnLine)); + +// Write a line plus the first byte of a UTF-8 multibyte character to make sure +// that it doesn’t get lost when closing the readline instance. +input.write(Buffer.concat([ + Buffer.from('foo\n'), + Buffer.from([ 0xe2 ]) // Exactly one third of a ☃ snowman. +])); + +function rl1OnLine(line) { + assert.strictEqual(line, 'foo'); + rl1.close(); + const rl2 = readline.createInterface({ + input, + output, + terminal: true + }); + + rl2.on('line', common.mustCall((line) => { + assert.strictEqual(line, '☃bar'); + rl2.close(); + })); + input.write(Buffer.from([0x98, 0x83])); // The rest of the ☃ snowman. + input.write('bar\n'); +} From a5f415fe8309fe7bb7531d3a03fe75eaa8be6ab7 Mon Sep 17 00:00:00 2001 From: XadillaX Date: Thu, 8 Jun 2017 21:12:11 +0800 Subject: [PATCH 34/51] src: merge `fn_name` in NODE_SET_PROTOTYPE_METHOD Merge two duplicate `fn_name` into one in NODE_SET_PROTOTYPE_METHOD, it may improve a bit performance. PR-URL: https://github.com/nodejs/node/pull/13547 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- src/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.h b/src/node.h index 329a3c623bd..65f6852a482 100644 --- a/src/node.h +++ b/src/node.h @@ -293,7 +293,7 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local recv, v8::FunctionTemplate::New(isolate, callback, v8::Local(), s); v8::Local fn_name = v8::String::NewFromUtf8(isolate, name); t->SetClassName(fn_name); - recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), t); + recv->PrototypeTemplate()->Set(fn_name, t); } #define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD From 2c1133d5fe468b4577a0844957349b1be7453590 Mon Sep 17 00:00:00 2001 From: Samuel Reed Date: Thu, 3 Nov 2016 11:23:57 -0500 Subject: [PATCH 35/51] doc: add readline.emitKeypressEvents note PR-URL: https://github.com/nodejs/node/pull/9447 Reviewed-By: Anna Henningsen Reviewed-By: Gibson Fahnestock --- doc/api/readline.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/readline.md b/doc/api/readline.md index bcd68d8085d..767f8ccefcd 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -457,6 +457,10 @@ autocompletion is disabled when copy-pasted input is detected. If the `stream` is a [TTY][], then it must be in raw mode. +*Note*: This is automatically called by any readline instance on its `input` +if the `input` is a terminal. Closing the `readline` instance does not stop +the `input` from emitting `'keypress'` events. + ```js readline.emitKeypressEvents(process.stdin); if (process.stdin.isTTY) From b967b4cbc5dee5c80f9939f34133d26b5605e5a2 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Thu, 1 Jun 2017 17:43:34 -0400 Subject: [PATCH 36/51] build: merge test suite groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/13378 Refs: https://github.com/nodejs/node/pull/13340 Refs: https://github.com/nodejs/node/pull/13336 Reviewed-By: Anna Henningsen Reviewed-By: Andreas Madsen Reviewed-By: João Reis --- vcbuild.bat | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index ae2c50e1c6c..77f553c7022 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -44,6 +44,8 @@ set enable_static= set build_addons_napi= set test_node_inspect= set test_check_deopts= +set js_test_suites=inspector known_issues message parallel sequential +set "common_test_suites=%js_test_suites% doctool addons addons-napi&set build_addons=1&set build_addons_napi=1" :next-arg if "%1"=="" goto args-done @@ -65,8 +67,8 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok -if /i "%1"=="test" set test_args=%test_args% doctool known_issues message parallel sequential addons addons-napi -J&set cpplint=1&set jslint=1&set build_addons=1&set build_addons_napi=1&goto arg-ok -if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap doctool inspector known_issues message sequential parallel addons addons-napi&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&set build_addons_napi=1&goto arg-ok +if /i "%1"=="test" set test_args=%test_args% -J %common_test_suites%&set cpplint=1&set jslint=1&goto arg-ok +if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap %common_test_suites%&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&goto arg-ok if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok if /i "%1"=="test-addons-napi" set test_args=%test_args% addons-napi&set build_addons_napi=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok @@ -76,8 +78,8 @@ if /i "%1"=="test-inspector" set test_args=%test_args% inspector&goto arg-ok if /i "%1"=="test-tick-processor" set test_args=%test_args% tick-processor&goto arg-ok if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok -if /i "%1"=="test-all" set test_args=%test_args% sequential parallel message gc inspector internet pummel&set build_testgc_addon=1&set cpplint=1&set jslint=1&goto arg-ok if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues&goto arg-ok +if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set build_testgc_addon=1&set cpplint=1&set jslint=1&goto arg-ok if /i "%1"=="test-node-inspect" set test_node_inspect=1&goto arg-ok if /i "%1"=="test-check-deopts" set test_check_deopts=1&goto arg-ok if /i "%1"=="jslint" set jslint=1&goto arg-ok @@ -487,7 +489,7 @@ echo Failed to create vc project files. goto exit :help -echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vs2015/vs2017] [download-all] [enable-vtune] [lint/lint-ci] [no-NODE-OPTIONS] +echo vcbuild.bat [debug/release] [msi] [test/test-ci/test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vs2015/vs2017] [download-all] [enable-vtune] [lint/lint-ci] [no-NODE-OPTIONS] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build From 52f5e3f80479534118bd6969e838394be4665456 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Sat, 10 Jun 2017 21:36:13 +0300 Subject: [PATCH 37/51] doc: use HTTPS URL for suggested upstream remote It's impossible to push to git:// URLs. PR-URL: https://github.com/nodejs/node/pull/13602 Fixes: https://github.com/nodejs/node/issues/13600 Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Gibson Fahnestock Reviewed-By: Brian White --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e11be25b023..7f9bd33e055 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ locally. ```text $ git clone git@github.com:username/node.git $ cd node -$ git remote add upstream git://github.com/nodejs/node.git +$ git remote add upstream https://github.com/nodejs/node.git ``` #### Which branch? From 00d2f7c8182372666e1a90d4841baa6394a546b9 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 5 Jun 2017 17:45:41 -0400 Subject: [PATCH 38/51] build,windows: check for VS version and arch PR-URL: https://github.com/nodejs/node/pull/13485 Fixes: https://github.com/nodejs/node/issues/13398 Reviewed-By: James M Snell --- vcbuild.bat | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 77f553c7022..8c9658b7e3d 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -166,12 +166,16 @@ if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64 :vs-set-2017 if "%target_env%" NEQ "vs2017" goto vs-set-2015 echo Looking for Visual Studio 2017 -if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2017 +@rem check if VS2017 is already setup, and for the requested arch +if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2017 +set "VSINSTALLDIR=" call tools\msvs\vswhere_usability_wrapper.cmd if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015 +@rem need to clear VSINSTALLDIR for vcvarsall to work as expected set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg% echo calling: %vcvars_call% call %vcvars_call% + :found_vs2017 echo Found MSVS version %VisualStudioVersion% set GYP_MSVS_VERSION=2017 @@ -193,10 +197,9 @@ if defined msi ( goto wix-not-found ) ) -if "%VCVARS_VER%" NEQ "140" ( - call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" - SET VCVARS_VER=140 -) +@rem VS2015 vsvarsall is quick, so run anyway +call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" +SET VCVARS_VER=140 if not defined VCINSTALLDIR goto msbuild-not-found set GYP_MSVS_VERSION=2015 set PLATFORM_TOOLSET=v140 From 812e0b0fbf0beff0f9c06c7c927587c5ace3e73e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 8 Jun 2017 12:25:31 -0700 Subject: [PATCH 39/51] test: refactor async-hooks test-callback-error Two child processes have their logic in a switch statement and a third uses an `if` statement to detect it. Move all three child process tasks into switch statement. PR-URL: https://github.com/nodejs/node/pull/13554 Reviewed-By: Trevor Norris Reviewed-By: Refael Ackermann Reviewed-By: David Cai Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Yuta Hiroto --- test/async-hooks/test-callback-error.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/async-hooks/test-callback-error.js b/test/async-hooks/test-callback-error.js index 8fe0177449e..6b09e4bb497 100644 --- a/test/async-hooks/test-callback-error.js +++ b/test/async-hooks/test-callback-error.js @@ -24,15 +24,14 @@ switch (process.argv[2]) { async_hooks.triggerId()); async_hooks.emitBefore(async_hooks.currentId()); break; -} - -if (process.execArgv.includes('--abort-on-uncaught-exception')) { - initHooks({ - oninit: common.mustCall(() => { throw new Error('test_callback_abort'); }) - }).enable(); + case 'test_callback_abort': + initHooks({ + oninit: common.mustCall(() => { throw new Error('test_callback_abort'); }) + }).enable(); - async_hooks.emitInit(async_hooks.currentId(), 'test_callback_abort', - async_hooks.triggerId()); + async_hooks.emitInit(async_hooks.currentId(), 'test_callback_abort', + async_hooks.triggerId()); + break; } const c1 = spawnSync(`${process.execPath}`, [__filename, 'test_init_callback']); From 4c5457fae50b06a7eaa8bb3ec8bbad473b9ea406 Mon Sep 17 00:00:00 2001 From: Sebastian Plesciuc Date: Wed, 7 Jun 2017 14:56:20 +0300 Subject: [PATCH 40/51] test: fix flaky test-http-client-get-url Fixed test-http-client-get-url by waiting on HTTP GET requests to finish before closing the server. PR-URL: https://github.com/nodejs/node/pull/13516 Fixes: https://github.com/nodejs/node/issues/13507 Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno --- test/parallel/test-http-client-get-url.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-http-client-get-url.js b/test/parallel/test-http-client-get-url.js index 1355339580b..53ccd66182a 100644 --- a/test/parallel/test-http-client-get-url.js +++ b/test/parallel/test-http-client-get-url.js @@ -25,19 +25,23 @@ const assert = require('assert'); const http = require('http'); const url = require('url'); const URL = url.URL; +const testPath = '/foo?bar'; -const server = http.createServer(common.mustCall(function(req, res) { +const server = http.createServer(common.mustCall((req, res) => { assert.strictEqual('GET', req.method); - assert.strictEqual('/foo?bar', req.url); + assert.strictEqual(testPath, req.url); res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('hello\n'); res.end(); - server.close(); }, 3)); -server.listen(0, function() { - const u = `http://127.0.0.1:${this.address().port}/foo?bar`; - http.get(u); - http.get(url.parse(u)); - http.get(new URL(u)); -}); +server.listen(0, common.localhostIPv4, common.mustCall(() => { + const u = `http://${common.localhostIPv4}:${server.address().port}${testPath}`; + http.get(u, common.mustCall(() => { + http.get(url.parse(u), common.mustCall(() => { + http.get(new URL(u), common.mustCall(() => { + server.close(); + })); + })); + })); +})); From 26d76307d5b7265b363ac52d0864bc65378d49ff Mon Sep 17 00:00:00 2001 From: Anshul Guleria Date: Sun, 11 Jun 2017 21:42:06 +0100 Subject: [PATCH 41/51] doc: fs constants for Node < v6.3.0 in fs.md Add changelog history in `fs.access` for the changes introduced to `constants` in the `fs` module prior to Node v6.3.0. PR-URL: https://github.com/nodejs/node/pull/12690 Fixes: https://github.com/nodejs/node/issues/8044 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Gibson Fahnestock --- doc/api/fs.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index fc3e5d95665..f61cacad6bd 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -426,6 +426,13 @@ changes: pr-url: https://github.com/nodejs/node/pull/10739 description: The `path` parameter can be a WHATWG `URL` object using `file:` protocol. Support is currently still *experimental*. + - version: v6.3.0 + pr-url: https://github.com/nodejs/node/pull/6534 + description: The constants like `fs.R_OK`, etc which were present directly + on `fs` were moved into `fs.constants` as a soft deprecation. + Thus for Node `< v6.3.0` use `fs` to access those constants, or + do something like `(fs.constants || fs).R_OK` to work with all + versions. --> * `path` {string|Buffer|URL} From 70432f211127361c26c87ad3168cf893543ee111 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 10 Jun 2017 23:00:52 -0700 Subject: [PATCH 42/51] doc: fix incorrect fs.utimes() link PR-URL: https://github.com/nodejs/node/pull/13608 Reviewed-By: Luigi Pinca Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott --- doc/api/fs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index f61cacad6bd..606e2d6a608 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2840,7 +2840,7 @@ The following constants are meant for use with the [`fs.Stats`][] object's [`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback [`fs.readFile`]: #fs_fs_readfile_file_options_callback [`fs.stat()`]: #fs_fs_stat_path_callback -[`fs.utimes()`]: #fs_fs_futimes_fd_atime_mtime_callback +[`fs.utimes()`]: #fs_fs_utimes_path_atime_mtime_callback [`fs.watch()`]: #fs_fs_watch_filename_options_listener [`fs.write()`]: #fs_fs_write_fd_buffer_offset_length_position_callback [`fs.writeFile()`]: #fs_fs_writefile_file_data_options_callback From 32c87ac6f390eefe0b7fb47cc166f668da34ec96 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Thu, 8 Jun 2017 18:30:57 +0300 Subject: [PATCH 43/51] benchmark: fix some RegExp nits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Take RegExp creation out of cycle. * use test(), not match() in boolean context. PR-URL: https://github.com/nodejs/node/pull/13551 Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca --- benchmark/buffers/buffer-write.js | 2 +- benchmark/common.js | 3 ++- benchmark/crypto/cipher-stream.js | 2 +- benchmark/crypto/hash-stream-creation.js | 2 +- benchmark/crypto/hash-stream-throughput.js | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index 758c8b8b514..2f1eb08763b 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -52,7 +52,7 @@ function main(conf) { var buff = new clazz(8); var fn = `write${conf.type}`; - if (fn.match(/Int/)) + if (/Int/.test(fn)) benchInt(buff, fn, len, noAssert); else benchFloat(buff, fn, len, noAssert); diff --git a/benchmark/common.js b/benchmark/common.js index bc9c21b3902..622d053e5f9 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -40,9 +40,10 @@ function Benchmark(fn, configs, options) { Benchmark.prototype._parseArgs = function(argv, configs) { const cliOptions = {}; const extraOptions = {}; + const validArgRE = /^(.+?)=([\s\S]*)$/; // Parse configuration arguments for (const arg of argv) { - const match = arg.match(/^(.+?)=([\s\S]*)$/); + const match = arg.match(validArgRE); if (!match) { console.error(`bad argument: ${arg}`); process.exit(1); diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 90bf548c76c..9fd88f1d864 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -11,7 +11,7 @@ var bench = common.createBenchmark(main, { function main(conf) { var api = conf.api; - if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) { + if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) { console.error('Crypto streams not available until v0.10'); // use the legacy, just so that we can compare them. api = 'legacy'; diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js index 296127ab384..dfab32c8af7 100644 --- a/benchmark/crypto/hash-stream-creation.js +++ b/benchmark/crypto/hash-stream-creation.js @@ -15,7 +15,7 @@ var bench = common.createBenchmark(main, { function main(conf) { var api = conf.api; - if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) { + if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) { console.error('Crypto streams not available until v0.10'); // use the legacy, just so that we can compare them. api = 'legacy'; diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js index dbb2e5c9995..cedaeb872f4 100644 --- a/benchmark/crypto/hash-stream-throughput.js +++ b/benchmark/crypto/hash-stream-throughput.js @@ -14,7 +14,7 @@ var bench = common.createBenchmark(main, { function main(conf) { var api = conf.api; - if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) { + if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) { console.error('Crypto streams not available until v0.10'); // use the legacy, just so that we can compare them. api = 'legacy'; From e713482147ddb7d8c5f36842fbbd2854c7ccd51f Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Thu, 8 Jun 2017 23:11:50 +0300 Subject: [PATCH 44/51] test: fix typo in test-cli-node-options.js `expect` was probably a typo, as it is a function and will always be `undefined` as JSON. The previous `test()` check infers it should be `want`. PR-URL: https://github.com/nodejs/node/pull/13558 Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto Reviewed-By: Alexey Orlenko Reviewed-By: Michael Dawson Reviewed-By: Luigi Pinca --- test/parallel/test-cli-node-options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index bff04718089..0c39813cf62 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -72,8 +72,8 @@ function expect(opt, want) { assert.ifError(err); if (!RegExp(want).test(stdout)) { console.error('For %j, failed to find %j in: <\n%s\n>', - opt, expect, stdout); - assert(false, `Expected ${expect}`); + opt, want, stdout); + assert.fail(`Expected ${want}`); } })); } From 68c0518e48a756d8c74a3311684a3e24cbfab16b Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Fri, 9 Jun 2017 15:14:51 +0300 Subject: [PATCH 45/51] doc: fix links and typos in fs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/13573 Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/fs.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 606e2d6a608..a2a8165e3a2 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1706,7 +1706,7 @@ changes: parameter in case of success. - version: v5.0.0 pr-url: https://github.com/nodejs/node/pull/3163 - description: The `file` parameter can be a file descriptor now. + description: The `path` parameter can be a file descriptor now. --> * `path` {string|Buffer|URL|integer} filename or file descriptor @@ -1766,7 +1766,7 @@ changes: protocol. Support is currently still *experimental*. - version: v5.0.0 pr-url: https://github.com/nodejs/node/pull/3163 - description: The `file` parameter can be a file descriptor now. + description: The `path` parameter can be a file descriptor now. --> * `path` {string|Buffer|URL|integer} filename or file descriptor @@ -1774,7 +1774,7 @@ changes: * `encoding` {string|null} default = `null` * `flag` {string} default = `'r'` -Synchronous version of [`fs.readFile`][]. Returns the contents of the `file`. +Synchronous version of [`fs.readFile()`][]. Returns the contents of the `path`. If the `encoding` option is specified then this function returns a string. Otherwise it returns a buffer. @@ -2838,7 +2838,8 @@ The following constants are meant for use with the [`fs.Stats`][] object's [`fs.mkdtemp()`]: #fs_fs_mkdtemp_prefix_options_callback [`fs.open()`]: #fs_fs_open_path_flags_mode_callback [`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback -[`fs.readFile`]: #fs_fs_readfile_file_options_callback +[`fs.readFile()`]: #fs_fs_readfile_path_options_callback +[`fs.readFileSync()`]: #fs_fs_readfilesync_path_options [`fs.stat()`]: #fs_fs_stat_path_callback [`fs.utimes()`]: #fs_fs_utimes_path_atime_mtime_callback [`fs.watch()`]: #fs_fs_watch_filename_options_listener From 38a1cfb5e6de5441ec58c11498deb57b5bf8d926 Mon Sep 17 00:00:00 2001 From: Rajaram Gaunker Date: Thu, 8 Jun 2017 01:17:02 -0700 Subject: [PATCH 46/51] v8: add a js class for Serializer/Dserializer Calling Serializer/Deserializer without new crashes node. Adding a js class which just inherits cpp bindings. Added regression tests. Fixes: https://github.com/nodejs/node/issues/13326 PR-URL: https://github.com/nodejs/node/pull/13541 Reviewed-By: Refael Ackermann Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- lib/v8.js | 12 +++++++++++- test/parallel/test-v8-serdes.js | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/v8.js b/lib/v8.js index e5b31564ad6..ba95c98dadc 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -15,11 +15,21 @@ 'use strict'; const { Buffer } = require('buffer'); -const { Serializer, Deserializer } = process.binding('serdes'); +const { + Serializer: _Serializer, + Deserializer: _Deserializer +} = process.binding('serdes'); const { copy } = process.binding('buffer'); const { objectToString } = require('internal/util'); const { FastBuffer } = require('internal/buffer'); +// Calling exposed c++ functions directly throws exception as it expected to be +// called with new operator and caused an assert to fire. +// Creating JS wrapper so that it gets caught at JS layer. +class Serializer extends _Serializer { } + +class Deserializer extends _Deserializer { } + const { cachedDataVersionTag, setFlagsFromString, diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index d3a879fc225..806cbc5fc34 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -131,3 +131,15 @@ const objects = [ assert.deepStrictEqual(v8.deserialize(buf), expectedResult); } + +{ + assert.throws( + () => { v8.Serializer(); }, + /^TypeError: Class constructor Serializer cannot be invoked without 'new'$/ + ); + + assert.throws( + () => { v8.Deserializer(); }, + /^TypeError: Class constructor Deserializer cannot be invoked without 'new'$/ + ); +} From fff8a56d6f1eaf4cc916e75f04eb8e2fb19b0b3d Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 9 Jun 2017 17:29:50 +0200 Subject: [PATCH 47/51] http: handle cases where socket.server is null Fixes a regression that caused an error to be thrown when trying to emit the 'timeout' event on the server referenced by `socket.server`. Fixes: https://github.com/nodejs/node/issues/13435 Refs: https://github.com/nodejs/node/pull/11926 PR-URL: https://github.com/nodejs/node/pull/13578 Reviewed-By: Colin Ihrig --- lib/_http_server.js | 5 +++ ...uster-send-socket-to-worker-http-server.js | 39 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 test/parallel/test-cluster-send-socket-to-worker-http-server.js diff --git a/lib/_http_server.js b/lib/_http_server.js index 9143fa1fc46..ca2e2dc4ff7 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -291,6 +291,11 @@ function connectionListener(socket) { httpSocketSetup(socket); + // Ensure that the server property of the socket is correctly set. + // See https://github.com/nodejs/node/issues/13435 + if (socket.server === null) + socket.server = this; + // If the user has added a listener to the server, // request, or response, then it's their responsibility. // otherwise, destroy on timeout by default diff --git a/test/parallel/test-cluster-send-socket-to-worker-http-server.js b/test/parallel/test-cluster-send-socket-to-worker-http-server.js new file mode 100644 index 00000000000..805603d2c9b --- /dev/null +++ b/test/parallel/test-cluster-send-socket-to-worker-http-server.js @@ -0,0 +1,39 @@ +'use strict'; + +// Regression test for https://github.com/nodejs/node/issues/13435 +// Tests that `socket.server` is correctly set when a socket is sent to a worker +// and the `'connection'` event is emitted manually on an HTTP server. + +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const http = require('http'); +const net = require('net'); + +if (cluster.isMaster) { + const worker = cluster.fork(); + const server = net.createServer(common.mustCall((socket) => { + worker.send('socket', socket); + })); + + worker.on('exit', common.mustCall((code) => { + assert.strictEqual(code, 0); + server.close(); + })); + + server.listen(0, common.mustCall(() => { + net.createConnection(server.address().port); + })); +} else { + const server = http.createServer(); + + server.on('connection', common.mustCall((socket) => { + assert.strictEqual(socket.server, server); + socket.destroy(); + cluster.worker.disconnect(); + })); + + process.on('message', common.mustCall((message, socket) => { + server.emit('connection', socket); + })); +} From 50e1f931a97e833f2520b3de195958013453e4ce Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Fri, 9 Jun 2017 17:14:35 -0400 Subject: [PATCH 48/51] profiler: declare missing `printErr` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `v8/tools/tickprocessor.js` assumes presence of global `printErr`, which is defined in `d8`. PR-URL: https://github.com/nodejs/node/pull/13590 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Tobias Nießen --- lib/internal/v8_prof_processor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js index 105ca30b12b..f0bcff7482d 100644 --- a/lib/internal/v8_prof_processor.js +++ b/lib/internal/v8_prof_processor.js @@ -18,6 +18,11 @@ scriptFiles.forEach(function(s) { script += process.binding('natives')[s] + '\n'; }); +// eslint-disable-next-line no-unused-vars +function printErr(err) { + console.error(err); +} + const tickArguments = []; if (process.platform === 'darwin') { tickArguments.push('--mac'); From a0f8faa3a4858a1540172a7e215c4ed62f8ecfc8 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Mon, 12 Jun 2017 11:40:52 +0200 Subject: [PATCH 49/51] v8: fix debug builds on Windows Adds missing return which fixes debug builds on Windows Fixes: https://github.com/nodejs/node/issues/13392 Ref: https://codereview.chromium.org/2929993003/ PR-URL: https://github.com/nodejs/node/pull/13634 Reviewed-By: Refael Ackermann Reviewed-By: Anna Henningsen --- deps/v8/src/api.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index f7f30217dd3..2610dc17104 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -437,7 +437,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { i::V8::SetSnapshotBlob(snapshot_blob); } -void* v8::ArrayBuffer::Allocator::Reserve(size_t length) { UNIMPLEMENTED(); } +void* v8::ArrayBuffer::Allocator::Reserve(size_t length) { + UNIMPLEMENTED(); + return nullptr; +} void v8::ArrayBuffer::Allocator::Free(void* data, size_t length, AllocationMode mode) { From 2cb6f2b281eb96a7abe16d58af6ebc9ce23d2e96 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Thu, 8 Jun 2017 17:20:24 +0300 Subject: [PATCH 50/51] http: fix timeout reset after keep-alive timeout Fix the logic of resetting the socket timeout of keep-alive HTTP connections and add two tests: * `test-http-server-keep-alive-timeout-slow-server` is a regression test for GH-13391. It ensures that the server-side keep-alive timeout will not fire during processing of a request. * `test-http-server-keep-alive-timeout-slow-client-headers` ensures that the regular socket timeout is restored as soon as a client starts sending a new request, not as soon as the whole message is received, so that the keep-alive timeout will not fire while, e.g., the client is sending large cookies. Refs: https://github.com/nodejs/node/pull/2534 Fixes: https://github.com/nodejs/node/issues/13391 PR-URL: https://github.com/nodejs/node/pull/13549 Reviewed-By: Refael Ackermann Reviewed-By: Matteo Collina Reviewed-By: Brian White --- lib/_http_server.js | 20 ++++--- ...-keep-alive-timeout-slow-client-headers.js | 57 +++++++++++++++++++ ...p-server-keep-alive-timeout-slow-server.js | 50 ++++++++++++++++ 3 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 test/parallel/test-http-server-keep-alive-timeout-slow-client-headers.js create mode 100644 test/parallel/test-http-server-keep-alive-timeout-slow-server.js diff --git a/lib/_http_server.js b/lib/_http_server.js index ca2e2dc4ff7..b6a5841cddc 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -438,14 +438,6 @@ function socketOnData(server, socket, parser, state, d) { assert(!socket._paused); debug('SERVER socketOnData %d', d.length); - if (state.keepAliveTimeoutSet) { - socket.setTimeout(0); - if (server.timeout) { - socket.setTimeout(server.timeout); - } - state.keepAliveTimeoutSet = false; - } - var ret = parser.execute(d); onParserExecuteCommon(server, socket, parser, state, ret, d); } @@ -466,6 +458,8 @@ function socketOnError(e) { } function onParserExecuteCommon(server, socket, parser, state, ret, d) { + resetSocketTimeout(server, socket, state); + if (ret instanceof Error) { debug('parse error', ret); socketOnError.call(socket, ret); @@ -547,6 +541,8 @@ function resOnFinish(req, res, socket, state, server) { // new message. In this callback we setup the response object and pass it // to the user. function parserOnIncoming(server, socket, state, req, keepAlive) { + resetSocketTimeout(server, socket, state); + state.incoming.push(req); // If the writable end isn't consuming, then stop reading @@ -608,6 +604,14 @@ function parserOnIncoming(server, socket, state, req, keepAlive) { return false; // Not a HEAD response. (Not even a response!) } +function resetSocketTimeout(server, socket, state) { + if (!state.keepAliveTimeoutSet) + return; + + socket.setTimeout(server.timeout || 0); + state.keepAliveTimeoutSet = false; +} + function onSocketResume() { // It may seem that the socket is resumed, but this is an enemy's trick to // deceive us! `resume` is emitted asynchronously, and may be called from diff --git a/test/parallel/test-http-server-keep-alive-timeout-slow-client-headers.js b/test/parallel/test-http-server-keep-alive-timeout-slow-client-headers.js new file mode 100644 index 00000000000..453831ecba8 --- /dev/null +++ b/test/parallel/test-http-server-keep-alive-timeout-slow-client-headers.js @@ -0,0 +1,57 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); +const net = require('net'); + +const server = http.createServer(common.mustCall((req, res) => { + res.end(); +}, 2)); + +server.keepAliveTimeout = common.platformTimeout(100); + +server.listen(0, common.mustCall(() => { + const port = server.address().port; + const socket = net.connect({ port }, common.mustCall(() => { + request(common.mustCall(() => { + // Make a second request on the same socket, after the keep-alive timeout + // has been set on the server side. + request(common.mustCall()); + })); + })); + + server.on('timeout', common.mustCall(() => { + socket.end(); + server.close(); + })); + + function request(callback) { + socket.setEncoding('utf8'); + socket.on('data', onData); + let response = ''; + + // Simulate a client that sends headers slowly (with a period of inactivity + // that is longer than the keep-alive timeout). + socket.write('GET / HTTP/1.1\r\n' + + `Host: localhost:${port}\r\n`); + setTimeout(() => { + socket.write('Connection: keep-alive\r\n' + + '\r\n'); + }, common.platformTimeout(300)); + + function onData(chunk) { + response += chunk; + if (chunk.includes('\r\n')) { + socket.removeListener('data', onData); + onHeaders(); + } + } + + function onHeaders() { + assert.ok(response.includes('HTTP/1.1 200 OK\r\n')); + assert.ok(response.includes('Connection: keep-alive\r\n')); + callback(); + } + } +})); diff --git a/test/parallel/test-http-server-keep-alive-timeout-slow-server.js b/test/parallel/test-http-server-keep-alive-timeout-slow-server.js new file mode 100644 index 00000000000..1543c1415fa --- /dev/null +++ b/test/parallel/test-http-server-keep-alive-timeout-slow-server.js @@ -0,0 +1,50 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer(common.mustCall((req, res) => { + if (req.url === '/first') { + res.end('ok'); + return; + } + setTimeout(() => { + res.end('ok'); + }, common.platformTimeout(500)); +}, 2)); + +server.keepAliveTimeout = common.platformTimeout(200); + +const agent = new http.Agent({ + keepAlive: true, + maxSockets: 1 +}); + +function request(path, callback) { + const port = server.address().port; + const req = http.request({ agent, path, port }, common.mustCall((res) => { + assert.strictEqual(res.statusCode, 200); + + res.setEncoding('utf8'); + + let result = ''; + res.on('data', (chunk) => { + result += chunk; + }); + + res.on('end', common.mustCall(() => { + assert.strictEqual(result, 'ok'); + callback(); + })); + })); + req.end(); +} + +server.listen(0, common.mustCall(() => { + request('/first', () => { + request('/second', () => { + server.close(); + }); + }); +})); From 3e1492ad3b7dd37ecc134bc46a7ed4f04d84070f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 10 Jun 2017 18:19:20 +0200 Subject: [PATCH 51/51] 2017-06-13, Version 8.1.1 (Current) * **Child processes** * `stdout` and `stderr` are now available on the error output of a failed call to the `util.promisify()`ed version of `child_process.exec`. [[`d66d4fc94c`](https://github.com/nodejs/node/commit/d66d4fc94c)] [#13388](https://github.com/nodejs/node/pull/13388) * **HTTP** * A regression that broke certain scenarios in which HTTP is used together with the `cluster` module has been fixed. [[`fff8a56d6f`](https://github.com/nodejs/node/commit/fff8a56d6f)] [#13578](https://github.com/nodejs/node/pull/13578) * **HTTPS** * The `rejectUnauthorized` option now works properly for unix sockets. [[`c4cbd99d37`](https://github.com/nodejs/node/commit/c4cbd99d37)] [#13505](https://github.com/nodejs/node/pull/13505) * **Readline** * A change that broke `npm init` and other code which uses `readline` multiple times on the same input stream is reverted. [[`0df6c0b5f0`](https://github.com/nodejs/node/commit/0df6c0b5f0)] [#13560](https://github.com/nodejs/node/pull/13560) PR-URL: https://github.com/nodejs/node/pull/13598 --- CHANGELOG.md | 3 +- doc/changelogs/CHANGELOG_V8.md | 82 ++++++++++++++++++++++++++++++++++ src/node_version.h | 2 +- 3 files changed, 85 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2339e11e484..444d98dd966 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,8 @@ release. -8.1.0
+8.1.1
+8.1.0
8.0.0
diff --git a/doc/changelogs/CHANGELOG_V8.md b/doc/changelogs/CHANGELOG_V8.md index 1c65611f828..89fb9180eeb 100644 --- a/doc/changelogs/CHANGELOG_V8.md +++ b/doc/changelogs/CHANGELOG_V8.md @@ -6,6 +6,7 @@ +8.1.1
8.1.0
8.0.0
@@ -22,6 +23,87 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2017-06-13, Version 8.1.1 (Current), @addaleax + +### Notable changes + +* **Child processes** + * `stdout` and `stderr` are now available on the error output of a + failed call to the `util.promisify()`ed version of + `child_process.exec`. + [[`d66d4fc94c`](https://github.com/nodejs/node/commit/d66d4fc94c)] + [#13388](https://github.com/nodejs/node/pull/13388) + +* **HTTP** + * A regression that broke certain scenarios in which HTTP is used together + with the `cluster` module has been fixed. + [[`fff8a56d6f`](https://github.com/nodejs/node/commit/fff8a56d6f)] + [#13578](https://github.com/nodejs/node/pull/13578) + +* **HTTPS** + * The `rejectUnauthorized` option now works properly for unix sockets. + [[`c4cbd99d37`](https://github.com/nodejs/node/commit/c4cbd99d37)] + [#13505](https://github.com/nodejs/node/pull/13505) + +* **Readline** + * A change that broke `npm init` and other code which uses `readline` + multiple times on the same input stream is reverted. + [[`0df6c0b5f0`](https://github.com/nodejs/node/commit/0df6c0b5f0)] + [#13560](https://github.com/nodejs/node/pull/13560) + +### Commits + +* [[`61c73085ba`](https://github.com/nodejs/node/commit/61c73085ba)] - **async_hooks**: minor refactor to callback invocation (Anna Henningsen) [#13419](https://github.com/nodejs/node/pull/13419) +* [[`bf61d97742`](https://github.com/nodejs/node/commit/bf61d97742)] - **async_hooks**: make sure `.{en|dis}able() === this` (Anna Henningsen) [#13418](https://github.com/nodejs/node/pull/13418) +* [[`32c87ac6f3`](https://github.com/nodejs/node/commit/32c87ac6f3)] - **benchmark**: fix some RegExp nits (Vse Mozhet Byt) [#13551](https://github.com/nodejs/node/pull/13551) +* [[`b967b4cbc5`](https://github.com/nodejs/node/commit/b967b4cbc5)] - **build**: merge test suite groups (Refael Ackermann) [#13378](https://github.com/nodejs/node/pull/13378) +* [[`00d2f7c818`](https://github.com/nodejs/node/commit/00d2f7c818)] - **build,windows**: check for VS version and arch (Refael Ackermann) [#13485](https://github.com/nodejs/node/pull/13485) +* [[`d66d4fc94c`](https://github.com/nodejs/node/commit/d66d4fc94c)] - **child_process**: promisify includes stdio in error (Gil Tayar) [#13388](https://github.com/nodejs/node/pull/13388) +* [[`0ca4bd1e18`](https://github.com/nodejs/node/commit/0ca4bd1e18)] - **child_process**: reduce nextTick() usage (Brian White) [#13459](https://github.com/nodejs/node/pull/13459) +* [[`d1fa59fbb7`](https://github.com/nodejs/node/commit/d1fa59fbb7)] - **child_process**: simplify send() result handling (Brian White) [#13459](https://github.com/nodejs/node/pull/13459) +* [[`d51b1c2e6f`](https://github.com/nodejs/node/commit/d51b1c2e6f)] - **cluster, dns, repl, tls, util**: fix RegExp nits (Vse Mozhet Byt) [#13536](https://github.com/nodejs/node/pull/13536) +* [[`68c0518e48`](https://github.com/nodejs/node/commit/68c0518e48)] - **doc**: fix links and typos in fs.md (Vse Mozhet Byt) [#13573](https://github.com/nodejs/node/pull/13573) +* [[`70432f2111`](https://github.com/nodejs/node/commit/70432f2111)] - **doc**: fix incorrect fs.utimes() link (Justin Beckwith) [#13608](https://github.com/nodejs/node/pull/13608) +* [[`26d76307d5`](https://github.com/nodejs/node/commit/26d76307d5)] - **doc**: fs constants for Node \< v6.3.0 in fs.md (Anshul Guleria) [#12690](https://github.com/nodejs/node/pull/12690) +* [[`52f5e3f804`](https://github.com/nodejs/node/commit/52f5e3f804)] - **doc**: use HTTPS URL for suggested upstream remote (Nikolai Vavilov) [#13602](https://github.com/nodejs/node/pull/13602) +* [[`2c1133d5fe`](https://github.com/nodejs/node/commit/2c1133d5fe)] - **doc**: add readline.emitKeypressEvents note (Samuel Reed) [#9447](https://github.com/nodejs/node/pull/9447) +* [[`53ec50d971`](https://github.com/nodejs/node/commit/53ec50d971)] - **doc**: fix napi_create_*_error signatures in n-api (Jamen Marzonie) [#13544](https://github.com/nodejs/node/pull/13544) +* [[`98d7f25181`](https://github.com/nodejs/node/commit/98d7f25181)] - **doc**: fix out of date sections in n-api doc (Michael Dawson) [#13508](https://github.com/nodejs/node/pull/13508) +* [[`85cac4ed53`](https://github.com/nodejs/node/commit/85cac4ed53)] - **doc**: update new CTC members (Refael Ackermann) [#13534](https://github.com/nodejs/node/pull/13534) +* [[`8c5407d321`](https://github.com/nodejs/node/commit/8c5407d321)] - **doc**: corrects reference to tlsClientError (Tarun) [#13533](https://github.com/nodejs/node/pull/13533) +* [[`3d12e1b455`](https://github.com/nodejs/node/commit/3d12e1b455)] - **doc**: emphasize Collaborators in GOVERNANCE.md (Rich Trott) [#13423](https://github.com/nodejs/node/pull/13423) +* [[`a9be8fff58`](https://github.com/nodejs/node/commit/a9be8fff58)] - **doc**: minimal documentation for Emeritus status (Rich Trott) [#13421](https://github.com/nodejs/node/pull/13421) +* [[`2778256680`](https://github.com/nodejs/node/commit/2778256680)] - **doc**: remove note highlighting in GOVERNANCE doc (Rich Trott) [#13420](https://github.com/nodejs/node/pull/13420) +* [[`2cb6f2b281`](https://github.com/nodejs/node/commit/2cb6f2b281)] - **http**: fix timeout reset after keep-alive timeout (Alexey Orlenko) [#13549](https://github.com/nodejs/node/pull/13549) +* [[`fff8a56d6f`](https://github.com/nodejs/node/commit/fff8a56d6f)] - **http**: handle cases where socket.server is null (Luigi Pinca) [#13578](https://github.com/nodejs/node/pull/13578) +* [[`c4cbd99d37`](https://github.com/nodejs/node/commit/c4cbd99d37)] - **https**: support rejectUnauthorized for unix sockets (cjihrig) [#13505](https://github.com/nodejs/node/pull/13505) +* [[`6a696d15ff`](https://github.com/nodejs/node/commit/6a696d15ff)] - **inspector**: fix crash on exception (Nikolai Vavilov) [#13455](https://github.com/nodejs/node/pull/13455) +* [[`50e1f931a9`](https://github.com/nodejs/node/commit/50e1f931a9)] - **profiler**: declare missing `printErr` (Fedor Indutny) [#13590](https://github.com/nodejs/node/pull/13590) +* [[`0df6c0b5f0`](https://github.com/nodejs/node/commit/0df6c0b5f0)] - ***Revert*** "**readline**: clean up event listener in onNewListener" (Anna Henningsen) [#13560](https://github.com/nodejs/node/pull/13560) +* [[`a5f415fe83`](https://github.com/nodejs/node/commit/a5f415fe83)] - **src**: merge `fn_name` in NODE_SET_PROTOTYPE_METHOD (XadillaX) [#13547](https://github.com/nodejs/node/pull/13547) +* [[`4a96ed4896`](https://github.com/nodejs/node/commit/4a96ed4896)] - **src**: check whether inspector is doing io (Sam Roberts) [#13504](https://github.com/nodejs/node/pull/13504) +* [[`f134c9d147`](https://github.com/nodejs/node/commit/f134c9d147)] - **src**: correct indentation for X509ToObject (Daniel Bevenius) [#13543](https://github.com/nodejs/node/pull/13543) +* [[`dd158b096f`](https://github.com/nodejs/node/commit/dd158b096f)] - **src**: make IsConstructCall checks consistent (Daniel Bevenius) [#13473](https://github.com/nodejs/node/pull/13473) +* [[`bf065344cf`](https://github.com/nodejs/node/commit/bf065344cf)] - **stream**: ensure that instanceof fast-path is hit. (Benedikt Meurer) [#13403](https://github.com/nodejs/node/pull/13403) +* [[`e713482147`](https://github.com/nodejs/node/commit/e713482147)] - **test**: fix typo in test-cli-node-options.js (Vse Mozhet Byt) [#13558](https://github.com/nodejs/node/pull/13558) +* [[`4c5457fae5`](https://github.com/nodejs/node/commit/4c5457fae5)] - **test**: fix flaky test-http-client-get-url (Sebastian Plesciuc) [#13516](https://github.com/nodejs/node/pull/13516) +* [[`812e0b0fbf`](https://github.com/nodejs/node/commit/812e0b0fbf)] - **test**: refactor async-hooks test-callback-error (Rich Trott) [#13554](https://github.com/nodejs/node/pull/13554) +* [[`2ea529b797`](https://github.com/nodejs/node/commit/2ea529b797)] - **test**: add regression test for 13557 (Anna Henningsen) [#13560](https://github.com/nodejs/node/pull/13560) +* [[`4d27930faf`](https://github.com/nodejs/node/commit/4d27930faf)] - **test**: fix flaky test-tls-socket-close (Rich Trott) [#13529](https://github.com/nodejs/node/pull/13529) +* [[`3da56ac9fb`](https://github.com/nodejs/node/commit/3da56ac9fb)] - **test**: harden test-dgram-bind-shared-ports (Refael Ackermann) [#13100](https://github.com/nodejs/node/pull/13100) +* [[`f686f73465`](https://github.com/nodejs/node/commit/f686f73465)] - **test**: add coverage for AsyncResource constructor (Gergely Nemeth) [#13327](https://github.com/nodejs/node/pull/13327) +* [[`12036a1d73`](https://github.com/nodejs/node/commit/12036a1d73)] - **test**: exercise once() with varying arguments (cjihrig) [#13524](https://github.com/nodejs/node/pull/13524) +* [[`1f88cbd620`](https://github.com/nodejs/node/commit/1f88cbd620)] - **test**: refactor test-http-server-keep-alive-timeout (realwakka) [#13448](https://github.com/nodejs/node/pull/13448) +* [[`bdbeb33dcb`](https://github.com/nodejs/node/commit/bdbeb33dcb)] - **test**: add hijackStdout and hijackStderr (XadillaX) [#13439](https://github.com/nodejs/node/pull/13439) +* [[`1c7f9171c0`](https://github.com/nodejs/node/commit/1c7f9171c0)] - **test**: add coverage for napi_property_descriptor (Michael Dawson) [#13510](https://github.com/nodejs/node/pull/13510) +* [[`c8db0475e0`](https://github.com/nodejs/node/commit/c8db0475e0)] - **test**: refactor test-fs-read-* (Rich Trott) [#13501](https://github.com/nodejs/node/pull/13501) +* [[`ad07c46b00`](https://github.com/nodejs/node/commit/ad07c46b00)] - **test**: refactor domain tests (Rich Trott) [#13480](https://github.com/nodejs/node/pull/13480) +* [[`fe5ea3feb0`](https://github.com/nodejs/node/commit/fe5ea3feb0)] - **test**: check callback not invoked on lookup error (Rich Trott) [#13456](https://github.com/nodejs/node/pull/13456) +* [[`216cb3f6e9`](https://github.com/nodejs/node/commit/216cb3f6e9)] - **test,benchmark**: stabilize child-process (Refael Ackermann) [#13457](https://github.com/nodejs/node/pull/13457) +* [[`a0f8faa3a4`](https://github.com/nodejs/node/commit/a0f8faa3a4)] - **v8**: fix debug builds on Windows (Bartosz Sosnowski) [#13634](https://github.com/nodejs/node/pull/13634) +* [[`38a1cfb5e6`](https://github.com/nodejs/node/commit/38a1cfb5e6)] - **v8**: add a js class for Serializer/Dserializer (Rajaram Gaunker) [#13541](https://github.com/nodejs/node/pull/13541) + ## 2017-06-07, Version 8.1.0 (Current), @jasnell diff --git a/src/node_version.h b/src/node_version.h index 92814947143..86af4f31060 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -26,7 +26,7 @@ #define NODE_MINOR_VERSION 1 #define NODE_PATCH_VERSION 1 -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)