Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge nodejs/master
Browse files Browse the repository at this point in the history
Merge 686e092 as of 2017-10-20.
This is an automatically created merge. For any problems please
contact @kunalspathak.
  • Loading branch information
chakrabot committed Oct 25, 2017
2 parents 40aeb28 + 686e092 commit 5b3d44e
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 18 deletions.
2 changes: 1 addition & 1 deletion doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
5 changes: 2 additions & 3 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'`
Expand Down Expand Up @@ -646,8 +645,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()`][]

Expand Down
9 changes: 9 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,15 @@ Type: Runtime
deprecated. Please use `fs.ftruncate()` or `fs.ftruncateSync()` to work with
file descriptors.
<a id="DEP0082"></a>
### 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
Expand Down
14 changes: 9 additions & 5 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ function REPLServer(prompt,
self.line = prefix;
self.cursor = prefix.length;
}
self.memory(cmd);
_memory.call(self, cmd);
return;
}

Expand Down Expand Up @@ -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 ' +
Expand Down Expand Up @@ -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 || [];

Expand Down Expand Up @@ -1185,7 +1189,7 @@ REPLServer.prototype.memory = function memory(cmd) {
} else {
self.lines.level = [];
}
};
}

function addStandardGlobals(completionGroups, filter) {
// Global object properties
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-https-client-resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions test/parallel/test-internal-util-decorate-error-stack.js
Original file line number Diff line number Diff line change
@@ -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'];
Expand Down Expand Up @@ -35,8 +35,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);
Expand Down
15 changes: 15 additions & 0 deletions test/parallel/test-repl-memory-deprecation.js
Original file line number Diff line number Diff line change
@@ -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();
}
2 changes: 0 additions & 2 deletions vcbuild.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@echo off

setlocal EnableExtensions

cd %~dp0

if /i "%1"=="help" goto help
Expand Down

0 comments on commit 5b3d44e

Please sign in to comment.