From 98f744cbc9a6cb844595e028a23a925b7f7edfe1 Mon Sep 17 00:00:00 2001 From: Yosuke Furukawa Date: Wed, 17 Jan 2018 16:36:59 +0900 Subject: [PATCH 01/15] doc: fix typo in TextEncoding section PR-URL: https://github.com/nodejs/node/pull/18201 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Khaidi Chu Reviewed-By: Richard Lau Reviewed-By: Vse Mozhet Byt Reviewed-By: Weijia Wang Reviewed-By: Benjamin Gruenbaum --- doc/api/util.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/util.md b/doc/api/util.md index 864a866a731..68f8487b1ba 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -869,7 +869,7 @@ const uint8array = encoder.encode('this is some data'); UTF-8 encodes the `input` string and returns a `Uint8Array` containing the encoded bytes. -### textDecoder.encoding +### textEncoder.encoding * {string} From 5aa0f3ee169caf1eba9c3b013c1f757f73404029 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 15 Jan 2018 14:43:06 -0500 Subject: [PATCH 02/15] doc: update sample output for process.versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update so that it includes some of the more recent additions. PR-URL: https://github.com/nodejs/node/pull/18167 Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Minwoo Jung Reviewed-By: Richard Lau --- doc/api/process.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 176c9b0b163..44b48b4f4b6 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1911,18 +1911,19 @@ Will generate an object similar to: ```js -{ - http_parser: '2.3.0', - node: '1.1.1', - v8: '6.1.534.42-node.0', - uv: '1.3.0', - zlib: '1.2.8', - ares: '1.10.0-DEV', - modules: '43', - icu: '55.1', - openssl: '1.0.1k', - unicode: '8.0', - cldr: '29.0', +{ http_parser: '2.7.0', + node: '8.9.0', + v8: '6.3.292.48-node.6', + uv: '1.18.0', + zlib: '1.2.11', + ares: '1.13.0', + modules: '60', + nghttp2: '1.29.0', + napi: '2', + openssl: '1.0.2n', + icu: '60.1', + unicode: '10.0', + cldr: '32.0', tz: '2016b' } ``` From 82bdf8fba2d3f197522e31ee49f3cc4f5f52bd53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=88=9A?= Date: Fri, 12 Jan 2018 23:21:44 +0800 Subject: [PATCH 03/15] fs: fix options.end of fs.ReadStream() Fixes: https://github.com/nodejs/node/issues/18116 PR-URL: https://github.com/nodejs/node/pull/18121 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Weijia Wang --- lib/fs.js | 3 ++- test/parallel/test-fs-read-stream.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/fs.js b/lib/fs.js index 39919306de1..db262f5da8f 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -2267,7 +2267,8 @@ function ReadStream(path, options) { this.flags = options.flags === undefined ? 'r' : options.flags; this.mode = options.mode === undefined ? 0o666 : options.mode; - this.start = options.start; + this.start = typeof this.fd !== 'number' && options.start === undefined ? + 0 : options.start; this.end = options.end; this.autoClose = options.autoClose === undefined ? true : options.autoClose; this.pos = undefined; diff --git a/test/parallel/test-fs-read-stream.js b/test/parallel/test-fs-read-stream.js index 1b9cc4aa90f..7fc7a0d56bc 100644 --- a/test/parallel/test-fs-read-stream.js +++ b/test/parallel/test-fs-read-stream.js @@ -164,6 +164,20 @@ common.expectsError( })); } +{ + // Verify that end works when start is not specified. + const stream = new fs.createReadStream(rangeFile, { end: 1 }); + stream.data = ''; + + stream.on('data', function(chunk) { + stream.data += chunk; + }); + + stream.on('end', common.mustCall(function() { + assert.strictEqual('xy', stream.data); + })); +} + { // pause and then resume immediately. const pauseRes = fs.createReadStream(rangeFile); From f7c709fdd0cd990b52f6cc9ea2cb486eb309a5bd Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 17 Jan 2018 23:22:48 +0200 Subject: [PATCH 04/15] doc: dedupe links Replace some repeated full links with concise ones and bottom references. PR-URL: https://github.com/nodejs/node/pull/18213 Reviewed-By: Jon Moss Reviewed-By: Joyee Cheung Reviewed-By: James M Snell --- doc/api/errors.md | 17 +++++++------- doc/api/n-api.md | 59 ++++++++++++++++++++--------------------------- 2 files changed, 34 insertions(+), 42 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 4bfce90bced..c42cdead2a5 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1193,8 +1193,8 @@ is not supported. ### ERR_INVALID_SYNC_FORK_INPUT A `Buffer`, `Uint8Array` or `string` was provided as stdio input to a -synchronous fork. See the documentation for the -[`child_process`](child_process.html) module for more information. +synchronous fork. See the documentation for the [`child_process`][] module +for more information. ### ERR_INVALID_THIS @@ -1250,22 +1250,22 @@ An attempt was made to use an IPC communication channel that was already closed. ### ERR_IPC_DISCONNECTED An attempt was made to disconnect an IPC communication channel that was already -disconnected. See the documentation for the -[`child_process`](child_process.html) module for more information. +disconnected. See the documentation for the [`child_process`][] module +for more information. ### ERR_IPC_ONE_PIPE An attempt was made to create a child Node.js process using more than one IPC -communication channel. See the documentation for the -[`child_process`](child_process.html) module for more information. +communication channel. See the documentation for the [`child_process`][] module +for more information. ### ERR_IPC_SYNC_FORK An attempt was made to open an IPC communication channel with a synchronously -forked Node.js process. See the documentation for the -[`child_process`](child_process.html) module for more information. +forked Node.js process. See the documentation for the [`child_process`][] module +for more information. ### ERR_METHOD_NOT_IMPLEMENTED @@ -1650,6 +1650,7 @@ An attempt was made to use a `zlib` object after it has already been closed. Creation of a [`zlib`][] object failed due to incorrect configuration. [`--force-fips`]: cli.html#cli_force_fips +[`child_process`]: child_process.html [`cipher.getAuthTag()`]: crypto.html#crypto_cipher_getauthtag [`crypto.timingSafeEqual()`]: crypto.html#crypto_crypto_timingsafeequal_a_b [`dgram.createSocket()`]: dgram.html#dgram_dgram_createsocket_options_callback diff --git a/doc/api/n-api.md b/doc/api/n-api.md index b868bb94ba9..3e32ce0701f 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -1016,8 +1016,7 @@ typedef enum { This represents the underlying binary scalar datatype of the TypedArray. Elements of this enum correspond to -[Section 22.2](https://tc39.github.io/ecma262/#sec-typedarray-objects) -of the [ECMAScript Language Specification][]. +[Section 22.2][] of the [ECMAScript Language Specification][]. ### Object Creation Functions #### napi_create_array @@ -1035,8 +1034,7 @@ Returns `napi_ok` if the API succeeded. This API returns an N-API value corresponding to a JavaScript Array type. JavaScript arrays are described in -[Section 22.1](https://tc39.github.io/ecma262/#sec-array-objects) of the -ECMAScript Language Specification. +[Section 22.1][] of the ECMAScript Language Specification. #### napi_create_array_with_length -* `timeout` {number} Milliseconds before a request is considered to be timed out. +* `timeout` {number} Milliseconds before a request times out. * `callback` {Function} Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. Once a socket is assigned to this request and is connected diff --git a/doc/api/readline.md b/doc/api/readline.md index 8619d751328..7ba1277dce2 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -60,8 +60,8 @@ The `'close'` event is emitted when one of the following occur: The listener function is called without passing any arguments. -The `readline.Interface` instance should be considered to be "finished" once -the `'close'` event is emitted. +The `readline.Interface` instance is finished once the `'close'` event is +emitted. ### Event: 'line'