From 76abf0fae0d015bd2b12d94fdd69bb4a4b1ed75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20F=C3=B8yn=20Berge?= Date: Fri, 6 Oct 2017 10:30:23 -0700 Subject: [PATCH 1/7] test: replace fixturesDir with fixtures module PR-URL: https://github.com/nodejs/node/pull/15947 Reviewed-By: Gireesh Punathil Reviewed-By: Michael Dawson Reviewed-By: Ruben Bridgewater Reviewed-By: Joyee Cheung --- test/parallel/test-internal-util-decorate-error-stack.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-internal-util-decorate-error-stack.js b/test/parallel/test-internal-util-decorate-error-stack.js index 7028188f6cd..d428e3c7ee2 100644 --- a/test/parallel/test-internal-util-decorate-error-stack.js +++ b/test/parallel/test-internal-util-decorate-error-stack.js @@ -1,11 +1,11 @@ // Flags: --expose_internals 'use strict'; -const common = require('../common'); +require('../common'); +const fixtures = require('../common/fixtures'); const assert = require('assert'); const internalUtil = require('internal/util'); const binding = process.binding('util'); const spawnSync = require('child_process').spawnSync; -const path = require('path'); const kArrowMessagePrivateSymbolIndex = binding['arrow_message_private_symbol']; const kDecoratedPrivateSymbolIndex = binding['decorated_private_symbol']; @@ -32,8 +32,7 @@ function checkStack(stack) { } let err; const badSyntaxPath = - path.join(common.fixturesDir, 'syntax', 'bad_syntax') - .replace(/\\/g, '\\\\'); + fixtures.path('syntax', 'bad_syntax').replace(/\\/g, '\\\\'); try { require(badSyntaxPath); From 7a29f440714e443a24bfe312ef9c799e0b821b0a Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Mon, 16 Oct 2017 17:24:17 -0400 Subject: [PATCH 2/7] repl: deprecate REPLServer.prototype.memory This method is only useful for the internal mechanics of the REPLServer and does not need to be exposed in user space. It was previously not documented, so I believe a Runtime deprecation makes sense. PR-URL: https://github.com/nodejs/node/pull/16242 Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Jeremiah Senkpiel --- doc/api/deprecations.md | 9 +++++++++ lib/repl.js | 14 +++++++++----- test/parallel/test-repl-memory-deprecation.js | 15 +++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 test/parallel/test-repl-memory-deprecation.js diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 2a21d645b6e..75c5c0feb57 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -728,6 +728,15 @@ Type: Runtime deprecated. Please use `fs.ftruncate()` or `fs.ftruncateSync()` to work with file descriptors. + +### DEP0082: REPLServer.prototype.memory() + +Type: Runtime + +`REPLServer.prototype.memory()` is a function only necessary for the +internal mechanics of the `REPLServer` itself, and is therefore not +necessary in user space. + [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array diff --git a/lib/repl.js b/lib/repl.js index c98ff7063b0..d4b95bf3a67 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -460,7 +460,7 @@ function REPLServer(prompt, self.line = prefix; self.cursor = prefix.length; } - self.memory(cmd); + _memory.call(self, cmd); return; } @@ -493,7 +493,7 @@ function REPLServer(prompt, function finish(e, ret) { debug('finish', e, ret); - self.memory(cmd); + _memory.call(self, cmd); if (e && !self[kBufferedCommandSymbol] && cmd.trim().startsWith('npm ')) { self.outputStream.write('npm should be run outside of the ' + @@ -1113,9 +1113,13 @@ REPLServer.prototype.defineCommand = function(keyword, cmd) { this.commands[keyword] = cmd; }; -REPLServer.prototype.memory = function memory(cmd) { - var self = this; +REPLServer.prototype.memory = util.deprecate( + _memory, + 'REPLServer.memory() is deprecated', + 'DEP0082'); +function _memory(cmd) { + const self = this; self.lines = self.lines || []; self.lines.level = self.lines.level || []; @@ -1185,7 +1189,7 @@ REPLServer.prototype.memory = function memory(cmd) { } else { self.lines.level = []; } -}; +} function addStandardGlobals(completionGroups, filter) { // Global object properties diff --git a/test/parallel/test-repl-memory-deprecation.js b/test/parallel/test-repl-memory-deprecation.js new file mode 100644 index 00000000000..9993360a286 --- /dev/null +++ b/test/parallel/test-repl-memory-deprecation.js @@ -0,0 +1,15 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const repl = require('repl'); + +testMemory(); + +function testMemory() { + const server = repl.start({ prompt: '> ' }); + const warn = 'REPLServer.memory() is deprecated'; + + common.expectWarning('DeprecationWarning', warn); + assert.strictEqual(server.memory(), undefined); + server.close(); +} From c3ae57f2536d3d7f3f496d6ee3e922c671ad7215 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Tue, 17 Oct 2017 18:54:17 -0400 Subject: [PATCH 3/7] build: revert "call setlocal in vcbuild.bat" This reverts commit b9a55a93c91fb7fd7ac81e182f843f28014179ca. PR-URL: https://github.com/nodejs/node/pull/16270 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Daniel Bevenius Reviewed-By: Anna Henningsen Reviewed-By: Myles Borins --- vcbuild.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index dde7faf1a27..4d315ad3ff9 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -1,7 +1,5 @@ @echo off -setlocal EnableExtensions - cd %~dp0 if /i "%1"=="help" goto help From c28466a2a440eb10d8dd8f1fb9467eb3e1b1a0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rodr=C3=ADguez=20Baquero?= Date: Fri, 20 Oct 2017 03:25:48 -0500 Subject: [PATCH 4/7] doc: add space after period child_process IPC channel note PR-URL: https://github.com/nodejs/node/pull/16334 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Yuta Hiroto --- doc/api/child_process.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 02f3201f2b8..fc75029d6ed 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -646,8 +646,8 @@ spawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] }); parent and child processes, and the child is a Node.js process, the child is launched with the IPC channel unreferenced (using `unref()`) until the child registers an event handler for the [`process.on('disconnect')`][] event -or the [`process.on('message')`][] event.This allows the child to exit normally -without the process being held open by the open IPC channel.* +or the [`process.on('message')`][] event. This allows the child to exit +normally without the process being held open by the open IPC channel.* See also: [`child_process.exec()`][] and [`child_process.fork()`][] From 023b95bf4abe5f37319ead5c5319bf531c3f4dbb Mon Sep 17 00:00:00 2001 From: tpurcell Date: Tue, 17 Oct 2017 14:34:01 -0400 Subject: [PATCH 5/7] test: replace fixturesDir with fixtures module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/16262 Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Gireesh Punathil --- test/parallel/test-https-client-resume.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-https-client-resume.js b/test/parallel/test-https-client-resume.js index d61d91964b0..149f0ccf01a 100644 --- a/test/parallel/test-https-client-resume.js +++ b/test/parallel/test-https-client-resume.js @@ -30,11 +30,11 @@ if (!common.hasCrypto) const assert = require('assert'); const https = require('https'); const tls = require('tls'); -const fs = require('fs'); +const fixtures = require('../common/fixtures'); const options = { - key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), - cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`) + key: fixtures.readKey('agent2-key.pem'), + cert: fixtures.readKey('agent2-cert.pem') }; // create server From 49e2651013c876376875c41621b3c96a9b6b6914 Mon Sep 17 00:00:00 2001 From: umatoma Date: Fri, 20 Oct 2017 18:26:10 +0900 Subject: [PATCH 6/7] doc: fix comment in assert.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/16335 Reviewed-By: Joyee Cheung Reviewed-By: Vse Mozhet Byt Reviewed-By: Luigi Pinca Reviewed-By: Gireesh Punathil Reviewed-By: Tobias Nießen Reviewed-By: Yuta Hiroto Reviewed-By: Anatoli Papirovski --- doc/api/assert.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/assert.md b/doc/api/assert.md index 58fd6484abe..d22fb3eac2b 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -441,7 +441,7 @@ assert.notDeepEqual(obj1, obj3); // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } assert.notDeepEqual(obj1, obj4); -// OK, obj1 and obj2 are not deeply equal +// OK, obj1 and obj4 are not deeply equal ``` If the values are deeply equal, an `AssertionError` is thrown with a `message` From 686e092202514dfc3cf93a463e9177a80dd42133 Mon Sep 17 00:00:00 2001 From: "aayush.a" Date: Fri, 20 Oct 2017 20:03:50 +0530 Subject: [PATCH 7/7] doc: remove duplicate options PR-URL: https://github.com/nodejs/node/pull/16339 Fixes: https://github.com/nodejs/node/issues/16332 Reviewed-By: Vse Mozhet Byt Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto --- doc/api/child_process.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index fc75029d6ed..a3c380d5715 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -135,7 +135,6 @@ changes: * `command` {string} The command to run, with space-separated arguments. * `options` {Object} - * `timeout` {number} (Default: `0`) * `cwd` {string} Current working directory of the child process. * `env` {Object} Environment key-value pairs. * `encoding` {string} **Default:** `'utf8'`