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 ff747e3 as of 2017-10-17.
This is an automatically created merge. For any problems please
contact @kunalspathak.
  • Loading branch information
chakrabot committed Oct 18, 2017
2 parents 24e76a2 + ff747e3 commit 46976d5
Show file tree
Hide file tree
Showing 53 changed files with 543 additions and 251 deletions.
32 changes: 32 additions & 0 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ exec('"my script.cmd" a b', (err, stdout, stderr) => {
### child_process.exec(command[, options][, callback])
<!-- YAML
added: v0.1.90
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
-->

* `command` {string} The command to run, with space-separated arguments.
Expand All @@ -145,6 +149,8 @@ added: v0.1.90
* `killSignal` {string|integer} **Default:** `'SIGTERM'`
* `uid` {number} Sets the user identity of the process (see setuid(2)).
* `gid` {number} Sets the group identity of the process (see setgid(2)).
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* `callback` {Function} called with the output when process terminates.
* `error` {Error}
* `stdout` {string|Buffer}
Expand Down Expand Up @@ -238,6 +244,10 @@ lsExample();
### child_process.execFile(file[, args][, options][, callback])
<!-- YAML
added: v0.1.91
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
-->

* `file` {string} The name or path of the executable file to run.
Expand All @@ -253,6 +263,8 @@ added: v0.1.91
* `killSignal` {string|integer} **Default:** `'SIGTERM'`
* `uid` {number} Sets the user identity of the process (see setuid(2)).
* `gid` {number} Sets the group identity of the process (see setgid(2)).
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* `callback` {Function} Called with the output when process terminates.
* `error` {Error}
* `stdout` {string|Buffer}
Expand Down Expand Up @@ -364,6 +376,9 @@ supported by `child_process.fork()` and will be ignored if set.
<!-- YAML
added: v0.1.90
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v6.4.0
pr-url: https://github.com/nodejs/node/pull/7696
description: The `argv0` option is supported now.
Expand All @@ -390,6 +405,8 @@ changes:
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
shell can be specified as a string. See [Shell Requirements][] and
[Default Windows Shell][]. **Default:** `false` (no shell).
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* Returns: {ChildProcess}

The `child_process.spawn()` method spawns a new process using the given
Expand Down Expand Up @@ -649,6 +666,9 @@ configuration at startup.
<!-- YAML
added: v0.11.12
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
Expand Down Expand Up @@ -678,6 +698,8 @@ changes:
stderr. **Default:** `200*1024` If exceeded, the child process is terminated.
See caveat at [`maxBuffer` and Unicode][].
* `encoding` {string} The encoding used for all stdio inputs and outputs. **Default:** `'buffer'`
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* Returns: {Buffer|string} The stdout from the command.

The `child_process.execFileSync()` method is generally identical to
Expand All @@ -698,6 +720,9 @@ throw an [`Error`][] that will include the full result of the underlying
<!-- YAML
added: v0.11.12
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
Expand Down Expand Up @@ -727,6 +752,8 @@ changes:
See caveat at [`maxBuffer` and Unicode][].
* `encoding` {string} The encoding used for all stdio inputs and outputs.
**Default:** `'buffer'`
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* Returns: {Buffer|string} The stdout from the command.

The `child_process.execSync()` method is generally identical to
Expand All @@ -749,6 +776,9 @@ execution.
<!-- YAML
added: v0.11.12
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
Expand Down Expand Up @@ -784,6 +814,8 @@ changes:
`'/bin/sh'` on UNIX, and `process.env.ComSpec` on Windows. A different
shell can be specified as a string. See [Shell Requirements][] and
[Default Windows Shell][]. **Default:** `false` (no shell).
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* Returns: {Object}
* `pid` {number} Pid of the child process.
* `output` {Array} Array of results from stdio output.
Expand Down
4 changes: 4 additions & 0 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,7 @@ added: v0.11.14
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the decrypted content.

Decrypts `buffer` with `privateKey`.

Expand All @@ -1704,6 +1705,7 @@ added: v1.1.0
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
`RSA_PKCS1_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the encrypted content.

Encrypts `buffer` with `privateKey`.

Expand All @@ -1721,6 +1723,7 @@ added: v1.1.0
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
`RSA_PKCS1_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the decrypted content.

Decrypts `buffer` with `publicKey`.

Expand All @@ -1741,6 +1744,7 @@ added: v0.11.14
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the encrypted content.

Encrypts the content of `buffer` with `publicKey` and returns a new
[`Buffer`][] with encrypted content.
Expand Down
4 changes: 2 additions & 2 deletions lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const net = require('net');
const util = require('util');
const EventEmitter = require('events');
const debug = util.debuglog('http');
const async_id_symbol = process.binding('async_wrap').async_id_symbol;
const nextTick = require('internal/process/next_tick').nextTick;
const { async_id_symbol } = process.binding('async_wrap');
const { nextTick } = require('internal/process/next_tick');

// New Agent code.

Expand Down
24 changes: 13 additions & 11 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,21 @@
const util = require('util');
const net = require('net');
const url = require('url');
const HTTPParser = process.binding('http_parser').HTTPParser;
const { HTTPParser } = process.binding('http_parser');
const assert = require('assert').ok;
const common = require('_http_common');
const httpSocketSetup = common.httpSocketSetup;
const parsers = common.parsers;
const freeParser = common.freeParser;
const debug = common.debug;
const OutgoingMessage = require('_http_outgoing').OutgoingMessage;
const {
_checkIsHttpToken: checkIsHttpToken,
debug,
freeParser,
httpSocketSetup,
parsers
} = require('_http_common');
const { OutgoingMessage } = require('_http_outgoing');
const Agent = require('_http_agent');
const Buffer = require('buffer').Buffer;
const { Buffer } = require('buffer');
const { urlToOptions, searchParamsSymbol } = require('internal/url');
const outHeadersKey = require('internal/http').outHeadersKey;
const nextTick = require('internal/process/next_tick').nextTick;
const { outHeadersKey } = require('internal/http');
const { nextTick } = require('internal/process/next_tick');
const errors = require('internal/errors');

// The actual list of disallowed characters in regexp form is more like:
Expand Down Expand Up @@ -149,7 +151,7 @@ function ClientRequest(options, cb) {
}

if (methodIsString && method) {
if (!common._checkIsHttpToken(method)) {
if (!checkIsHttpToken(method)) {
throw new errors.TypeError('ERR_INVALID_HTTP_TOKEN', 'Method', method);
}
method = this.method = method.toUpperCase();
Expand Down
15 changes: 8 additions & 7 deletions lib/_http_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
'use strict';

const binding = process.binding('http_parser');
const methods = binding.methods;
const HTTPParser = binding.HTTPParser;
const { methods, HTTPParser } = binding;

const FreeList = require('internal/freelist');
const ondrain = require('internal/http').ondrain;
const { ondrain } = require('internal/http');
const incoming = require('_http_incoming');
const emitDestroy = require('async_hooks').emitDestroy;
const IncomingMessage = incoming.IncomingMessage;
const readStart = incoming.readStart;
const readStop = incoming.readStop;
const { emitDestroy } = require('async_hooks');
const {
IncomingMessage,
readStart,
readStop
} = incoming;

const debug = require('util').debuglog('http');

Expand Down
13 changes: 6 additions & 7 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ const Stream = require('stream');
const util = require('util');
const internalUtil = require('internal/util');
const internalHttp = require('internal/http');
const Buffer = require('buffer').Buffer;
const { Buffer } = require('buffer');
const common = require('_http_common');
const checkIsHttpToken = common._checkIsHttpToken;
const checkInvalidHeaderChar = common._checkInvalidHeaderChar;
const outHeadersKey = require('internal/http').outHeadersKey;
const async_id_symbol = process.binding('async_wrap').async_id_symbol;
const nextTick = require('internal/process/next_tick').nextTick;
const { outHeadersKey } = require('internal/http');
const { async_id_symbol } = process.binding('async_wrap');
const { nextTick } = require('internal/process/next_tick');
const errors = require('internal/errors');

const CRLF = common.CRLF;
const debug = common.debug;
const utcDate = internalHttp.utcDate;
const { CRLF, debug } = common;
const { utcDate } = internalHttp;

var RE_FIELDS =
/^(?:Connection|Transfer-Encoding|Content-Length|Date|Expect|Trailer|Upgrade)$/i;
Expand Down
24 changes: 13 additions & 11 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@

const util = require('util');
const net = require('net');
const HTTPParser = process.binding('http_parser').HTTPParser;
const { HTTPParser } = process.binding('http_parser');
const assert = require('assert').ok;
const common = require('_http_common');
const parsers = common.parsers;
const freeParser = common.freeParser;
const debug = common.debug;
const CRLF = common.CRLF;
const continueExpression = common.continueExpression;
const chunkExpression = common.chunkExpression;
const httpSocketSetup = common.httpSocketSetup;
const OutgoingMessage = require('_http_outgoing').OutgoingMessage;
const {
parsers,
freeParser,
debug,
CRLF,
continueExpression,
chunkExpression,
httpSocketSetup,
_checkInvalidHeaderChar: checkInvalidHeaderChar
} = require('_http_common');
const { OutgoingMessage } = require('_http_outgoing');
const { outHeadersKey, ondrain } = require('internal/http');
const errors = require('internal/errors');

Expand Down Expand Up @@ -223,7 +225,7 @@ function writeHead(statusCode, reason, obj) {
headers = obj;
}

if (common._checkInvalidHeaderChar(this.statusMessage))
if (checkInvalidHeaderChar(this.statusMessage))
throw new errors.Error('ERR_INVALID_CHAR', 'statusMessage');

var statusLine = 'HTTP/1.1 ' + statusCode + ' ' + this.statusMessage + CRLF;
Expand Down
2 changes: 1 addition & 1 deletion lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Readable.ReadableState = ReadableState;

const EE = require('events');
const Stream = require('stream');
const Buffer = require('buffer').Buffer;
const { Buffer } = require('buffer');
const util = require('util');
const debug = util.debuglog('stream');
const BufferList = require('internal/streams/BufferList');
Expand Down
4 changes: 2 additions & 2 deletions lib/_stream_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const assert = require('assert');
const util = require('util');
const Socket = require('net').Socket;
const JSStream = process.binding('js_stream').JSStream;
const { Socket } = require('net');
const { JSStream } = process.binding('js_stream');
const uv = process.binding('uv');
const debug = util.debuglog('stream_wrap');
const errors = require('internal/errors');
Expand Down
2 changes: 1 addition & 1 deletion lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Writable.WritableState = WritableState;
const util = require('util');
const internalUtil = require('internal/util');
const Stream = require('stream');
const Buffer = require('buffer').Buffer;
const { Buffer } = require('buffer');
const destroyImpl = require('internal/streams/destroy');
const errors = require('internal/errors');

Expand Down
3 changes: 1 addition & 2 deletions lib/_tls_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const { isArrayBufferView } = require('internal/util/types');
const tls = require('tls');
const errors = require('internal/errors');

const SSL_OP_CIPHER_SERVER_PREFERENCE =
process.binding('constants').crypto.SSL_OP_CIPHER_SERVER_PREFERENCE;
const { SSL_OP_CIPHER_SERVER_PREFERENCE } = process.binding('constants').crypto;

// Lazily loaded
var crypto = null;
Expand Down
6 changes: 3 additions & 3 deletions lib/_tls_legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const internalUtil = require('internal/util');
internalUtil.assertCrypto();

const assert = require('assert');
const Buffer = require('buffer').Buffer;
const { Buffer } = require('buffer');
const common = require('_tls_common');
const Connection = process.binding('crypto').Connection;
const { Connection } = process.binding('crypto');
const EventEmitter = require('events');
const stream = require('stream');
const Timer = process.binding('timer_wrap').Timer;
const { Timer } = process.binding('timer_wrap');
const tls = require('tls');
const util = require('util');

Expand Down
10 changes: 5 additions & 5 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ const net = require('net');
const tls = require('tls');
const util = require('util');
const common = require('_tls_common');
const StreamWrap = require('_stream_wrap').StreamWrap;
const Buffer = require('buffer').Buffer;
const { StreamWrap } = require('_stream_wrap');
const { Buffer } = require('buffer');
const debug = util.debuglog('tls');
const Timer = process.binding('timer_wrap').Timer;
const { Timer } = process.binding('timer_wrap');
const tls_wrap = process.binding('tls_wrap');
const TCP = process.binding('tcp_wrap').TCP;
const Pipe = process.binding('pipe_wrap').Pipe;
const { TCP } = process.binding('tcp_wrap');
const { Pipe } = process.binding('pipe_wrap');
const errors = require('internal/errors');
const kConnectOptions = Symbol('connect-options');
const kDisableRenegotiation = Symbol('disable-renegotiation');
Expand Down
Loading

0 comments on commit 46976d5

Please sign in to comment.