From 617bfe48de5e0b3ba7852a45d075c075e8ba6064 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 12 Dec 2018 01:24:59 +0800 Subject: [PATCH 01/28] lib: remove internalBinding('config').pendingDeprecation Instead use `require('internal/options').getOptionValue('--pending-deprecation')` PR-URL: https://github.com/nodejs/node/pull/24962 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater --- lib/buffer.js | 6 ++--- lib/internal/bootstrap/node.js | 2 +- src/node_config.cc | 3 --- test/parallel/test-pending-deprecation.js | 32 +++++++++++++++-------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 83deacd1fb0ce1..aea97ae53bee0c 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -48,9 +48,7 @@ const { isArrayBufferView, isUint8Array } = require('internal/util/types'); -const { - pendingDeprecation -} = internalBinding('config'); + const { ERR_BUFFER_OUT_OF_BOUNDS, ERR_OUT_OF_RANGE, @@ -138,7 +136,7 @@ const bufferWarning = 'Buffer() is deprecated due to security and usability ' + function showFlaggedDeprecation() { if (bufferWarningAlreadyEmitted || ++nodeModulesCheckCounter > 10000 || - (!pendingDeprecation && + (!require('internal/options').getOptionValue('--pending-deprecation') && isInsideNodeModules())) { // We don't emit a warning, because we either: // - Already did so, or diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index d7e8ff5016f763..39237adab376c4 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -177,7 +177,7 @@ { // Install legacy getters on the `util` binding for typechecking. // TODO(addaleax): Turn into a full runtime deprecation. - const { pendingDeprecation } = internalBinding('config'); + const pendingDeprecation = getOptionValue('--pending-deprecation'); const utilBinding = internalBinding('util'); const types = internalBinding('types'); for (const name of [ diff --git a/src/node_config.cc b/src/node_config.cc index a8ffac2cc158a4..1ba1fe9d277af5 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -77,9 +77,6 @@ static void Initialize(Local target, if (env->options()->experimental_repl_await) READONLY_TRUE_PROPERTY(target, "experimentalREPLAwait"); - if (env->options()->pending_deprecation) - READONLY_TRUE_PROPERTY(target, "pendingDeprecation"); - if (env->options()->expose_internals) READONLY_TRUE_PROPERTY(target, "exposeInternals"); diff --git a/test/parallel/test-pending-deprecation.js b/test/parallel/test-pending-deprecation.js index bb11d84bcc0aec..6cabf9ddc693f7 100644 --- a/test/parallel/test-pending-deprecation.js +++ b/test/parallel/test-pending-deprecation.js @@ -1,36 +1,45 @@ 'use strict'; -// Tests that --pending-deprecation and NODE_PENDING_DEPRECATION both -// set the process.binding('config').pendingDeprecation flag that is -// used to determine if pending deprecation messages should be shown. -// The test is performed by launching two child processes that run +// Flags: --expose-internals +// Tests that --pending-deprecation and NODE_PENDING_DEPRECATION both set the +// `require('internal/options').getOptionValue('--pending-deprecation')` +// flag that is used to determine if pending deprecation messages should be +// shown. The test is performed by launching two child processes that run // this same test script with different arguments. If those exit with // code 0, then the test passes. If they don't, it fails. +// TODO(joyeecheung): instead of testing internals, test the actual features +// pending deprecations. + const common = require('../common'); const assert = require('assert'); -const config = process.binding('config'); const fork = require('child_process').fork; +const { getOptionValue } = require('internal/options'); function message(name) { - return `${name} did not set the process.binding('config').` + - 'pendingDeprecation flag.'; + return `${name} did not affect getOptionValue('--pending-deprecation')`; } switch (process.argv[2]) { case 'env': case 'switch': - assert.strictEqual(config.pendingDeprecation, true); + assert.strictEqual( + getOptionValue('--pending-deprecation'), + true + ); break; default: // Verify that the flag is off by default. const envvar = process.env.NODE_PENDING_DEPRECATION; - assert.strictEqual(config.pendingDeprecation, envvar && envvar[0] === '1'); + assert.strictEqual( + getOptionValue('--pending-deprecation'), + !!(envvar && envvar[0] === '1') + ); // Test the --pending-deprecation command line switch. fork(__filename, ['switch'], { - execArgv: ['--pending-deprecation'], + execArgv: ['--pending-deprecation', '--expose-internals'], silent: true }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('--pending-deprecation')); @@ -38,7 +47,7 @@ switch (process.argv[2]) { // Test the --pending_deprecation command line switch. fork(__filename, ['switch'], { - execArgv: ['--pending_deprecation'], + execArgv: ['--pending_deprecation', '--expose-internals'], silent: true }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('--pending_deprecation')); @@ -47,6 +56,7 @@ switch (process.argv[2]) { // Test the NODE_PENDING_DEPRECATION environment var. fork(__filename, ['env'], { env: Object.assign({}, process.env, { NODE_PENDING_DEPRECATION: 1 }), + execArgv: ['--expose-internals'], silent: true }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('NODE_PENDING_DEPRECATION')); From c168672158fff539bbff7e0391dc21fd0a8acd17 Mon Sep 17 00:00:00 2001 From: Beni von Cheni Date: Sun, 9 Dec 2018 22:12:39 -0500 Subject: [PATCH 02/28] inspector: move process.binding to internalBinding In places of process.binding('inspector'), migrate code to adapt internalBinding. PR-URL: https://github.com/nodejs/node/pull/24931 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Joyee Cheung Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater --- lib/inspector.js | 2 +- lib/internal/bootstrap/loaders.js | 1 + lib/internal/inspector_async_hook.js | 2 +- lib/internal/modules/cjs/helpers.js | 2 +- lib/internal/modules/cjs/loader.js | 2 +- lib/internal/modules/esm/module_job.js | 2 +- lib/internal/process/coverage.js | 2 +- src/inspector_js_api.cc | 2 +- src/node.cc | 2 +- test/parallel/test-process-binding-internalbinding-whitelist.js | 1 + test/sequential/test-async-wrap-getasyncid.js | 2 +- 11 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/inspector.js b/lib/inspector.js index 6988eccf82c9ef..f79ef9cec4e639 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -11,7 +11,7 @@ const { } = require('internal/errors').codes; const { validateString } = require('internal/validators'); const util = require('util'); -const { Connection, open, url } = process.binding('inspector'); +const { Connection, open, url } = internalBinding('inspector'); const { originalConsole } = require('internal/process/per_thread'); if (!Connection) diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 5c0a5b6aa1fb80..4d7bfa43f658d8 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -85,6 +85,7 @@ 'fs_event_wrap', 'http_parser', 'icu', + 'inspector', 'js_stream', 'natives', 'os', diff --git a/lib/internal/inspector_async_hook.js b/lib/internal/inspector_async_hook.js index 1ad0cbf3a533f2..4a3d31fc2ab7de 100644 --- a/lib/internal/inspector_async_hook.js +++ b/lib/internal/inspector_async_hook.js @@ -1,6 +1,6 @@ 'use strict'; -const inspector = process.binding('inspector'); +const inspector = internalBinding('inspector'); if (!inspector || !inspector.asyncTaskScheduled) { exports.setup = function() {}; diff --git a/lib/internal/modules/cjs/helpers.js b/lib/internal/modules/cjs/helpers.js index 2c856a99c6b8fd..fcb536c3df3738 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -108,7 +108,7 @@ if (getOptionValue('--experimental-worker')) { builtinLibs.sort(); } -if (typeof process.binding('inspector').open === 'function') { +if (typeof internalBinding('inspector').open === 'function') { builtinLibs.push('inspector'); builtinLibs.sort(); } diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 83ca0699773fa8..1b75f823f167ed 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -706,7 +706,7 @@ Module.prototype._compile = function(content, filename) { // Set breakpoint on module start if (filename === resolvedArgv) { delete process._breakFirstLine; - inspectorWrapper = process.binding('inspector').callAndPauseOnStart; + inspectorWrapper = internalBinding('inspector').callAndPauseOnStart; } } var dirname = path.dirname(filename); diff --git a/lib/internal/modules/esm/module_job.js b/lib/internal/modules/esm/module_job.js index 50aa00a09a03ee..fbb29aef783006 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -73,7 +73,7 @@ class ModuleJob { try { if (this.isMain && process._breakFirstLine) { delete process._breakFirstLine; - const initWrapper = process.binding('inspector').callAndPauseOnStart; + const initWrapper = internalBinding('inspector').callAndPauseOnStart; initWrapper(this.module.instantiate, this.module); } else { this.module.instantiate(); diff --git a/lib/internal/process/coverage.js b/lib/internal/process/coverage.js index 9c9b2b47119ea7..5c5d0c2b6171f3 100644 --- a/lib/internal/process/coverage.js +++ b/lib/internal/process/coverage.js @@ -51,7 +51,7 @@ function disableAllAsyncHooks() { exports.writeCoverage = writeCoverage; function setup() { - const { Connection } = process.binding('inspector'); + const { Connection } = internalBinding('inspector'); if (!Connection) { console.warn('inspector not enabled'); return; diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index 8f0332cc616341..3f05f02bb50ddb 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -315,5 +315,5 @@ void Initialize(Local target, Local unused, } // namespace inspector } // namespace node -NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector, +NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, node::inspector::Initialize); diff --git a/src/node.cc b/src/node.cc index e8710bef22d3d7..769d1ed8f447f3 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2238,5 +2238,5 @@ int Start(int argc, char** argv) { #if !HAVE_INSPECTOR void Initialize() {} -NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector, Initialize) +NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, Initialize) #endif // !HAVE_INSPECTOR diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-whitelist.js index c7b683a88a1376..7689ff1ca31ed4 100644 --- a/test/parallel/test-process-binding-internalbinding-whitelist.js +++ b/test/parallel/test-process-binding-internalbinding-whitelist.js @@ -16,4 +16,5 @@ assert(process.binding('url')); assert(process.binding('spawn_sync')); assert(process.binding('js_stream')); assert(process.binding('buffer')); +assert(process.binding('inspector')); assert(process.binding('os')); diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js index 3a59ade9a950a4..5c3a7b766fda99 100644 --- a/test/sequential/test-async-wrap-getasyncid.js +++ b/test/sequential/test-async-wrap-getasyncid.js @@ -291,7 +291,7 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check if (process.config.variables.v8_enable_inspector !== 0 && common.isMainThread) { - const binding = process.binding('inspector'); + const binding = internalBinding('inspector'); const handle = new binding.Connection(() => {}); testInitialized(handle, 'Connection'); handle.disconnect(); From dc4e5c5f23954e42593a10a8d9ea8b8d5a2efb58 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 13 Dec 2018 05:23:16 +0100 Subject: [PATCH 03/28] util: inspect ArrayBuffers contents as well Inspecting an ArrayBuffer now also shows their binary contents. PR-URL: https://github.com/nodejs/node/pull/25006 Reviewed-By: Anna Henningsen --- doc/api/util.md | 3 + lib/internal/util/inspect.js | 26 +++++++-- .../test-util-format-shared-arraybuffer.js | 6 -- test/parallel/test-util-format.js | 5 ++ test/parallel/test-util-inspect.js | 55 ++++++++++++------- 5 files changed, 65 insertions(+), 30 deletions(-) delete mode 100644 test/parallel/test-util-format-shared-arraybuffer.js diff --git a/doc/api/util.md b/doc/api/util.md index 7c5a0d2cd5921c..2dd0d0912bccea 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -375,6 +375,9 @@ stream.write('With ES6'); * `options` {Object} @@ -98,8 +101,11 @@ changes: * `colorMode` {boolean|string} Set color support for this `Console` instance. Setting to `true` enables coloring while inspecting values, setting to `'auto'` will make color support depend on the value of the `isTTY` property - and the value returned by `getColorDepth()` on the respective stream. + and the value returned by `getColorDepth()` on the respective stream. This + option can not be used, if `inspectOptions.colors` is set as well. **Default:** `'auto'`. + * `inspectOptions` {Object} Specifies options that are passed along to + [`util.inspect()`][]. Creates a new `Console` with one or two writable stream instances. `stdout` is a writable stream to print log or info output. `stderr` is used for warning or diff --git a/doc/api/errors.md b/doc/api/errors.md index b867dc4f1207c1..f504acd8c02a8f 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1141,6 +1141,12 @@ is set for the `Http2Stream`. `http2.connect()` was passed a URL that uses any protocol other than `http:` or `https:`. + +### ERR_INCOMPATIBLE_OPTION_PAIR + +An option pair is incompatible with each other and can not be used at the same +time. + ### ERR_INSPECTOR_ALREADY_CONNECTED diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 9588cd5ebe22ce..89987aeec1ffd3 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -10,6 +10,7 @@ const { ERR_CONSOLE_WRITABLE_STREAM, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, + ERR_INCOMPATIBLE_OPTION_PAIR, }, } = require('internal/errors'); const { previewEntries } = internalBinding('util'); @@ -54,6 +55,8 @@ const kBindStreamsLazy = Symbol('kBindStreamsLazy'); const kUseStdout = Symbol('kUseStdout'); const kUseStderr = Symbol('kUseStderr'); +const optionsMap = new WeakMap(); + function Console(options /* or: stdout, stderr, ignoreErrors = true */) { // We have to test new.target here to see if this function is called // with new, because we need to define a custom instanceof to accommodate @@ -74,7 +77,8 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { stdout, stderr = stdout, ignoreErrors = true, - colorMode = 'auto' + colorMode = 'auto', + inspectOptions } = options; if (!stdout || typeof stdout.write !== 'function') { @@ -87,6 +91,15 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { if (typeof colorMode !== 'boolean' && colorMode !== 'auto') throw new ERR_INVALID_ARG_VALUE('colorMode', colorMode); + if (inspectOptions) { + if (inspectOptions.colors !== undefined && + options.colorMode !== undefined) { + throw new ERR_INCOMPATIBLE_OPTION_PAIR( + 'inspectOptions.color', 'colorMode'); + } + optionsMap.set(this, inspectOptions); + } + // Bind the prototype functions to this Console instance var keys = Object.keys(Console.prototype); for (var v = 0; v < keys.length; v++) { @@ -243,6 +256,14 @@ Console.prototype[kGetInspectOptions] = function(stream) { stream.getColorDepth() > 2 : true); } + const options = optionsMap.get(this); + if (options) { + if (options.colors === undefined) { + options.colors = color; + } + return options; + } + return color ? kColorInspectOptions : kNoColorInspectOptions; }; diff --git a/lib/internal/errors.js b/lib/internal/errors.js index f78e776dfd20fd..e8e62b5d2ca3de 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -702,6 +702,8 @@ E('ERR_HTTP_INVALID_HEADER_VALUE', E('ERR_HTTP_INVALID_STATUS_CODE', 'Invalid status code: %s', RangeError); E('ERR_HTTP_TRAILER_INVALID', 'Trailers are invalid with this transfer encoding', Error); +E('ERR_INCOMPATIBLE_OPTION_PAIR', + 'Option "%s" can not be used in combination with option "%s"', TypeError); E('ERR_INSPECTOR_ALREADY_CONNECTED', '%s is already connected', Error); E('ERR_INSPECTOR_CLOSED', 'Session was closed', Error); E('ERR_INSPECTOR_NOT_AVAILABLE', 'Inspector is not available', Error); diff --git a/test/parallel/test-console-tty-colors.js b/test/parallel/test-console-tty-colors.js index 4f4064970ad6b7..85a0e61e381170 100644 --- a/test/parallel/test-console-tty-colors.js +++ b/test/parallel/test-console-tty-colors.js @@ -5,7 +5,7 @@ const util = require('util'); const { Writable } = require('stream'); const { Console } = require('console'); -function check(isTTY, colorMode, expectedColorMode) { +function check(isTTY, colorMode, expectedColorMode, inspectOptions) { const items = [ 1, { a: 2 }, @@ -18,7 +18,8 @@ function check(isTTY, colorMode, expectedColorMode) { write: common.mustCall((chunk, enc, cb) => { assert.strictEqual(chunk.trim(), util.inspect(items[i++], { - colors: expectedColorMode + colors: expectedColorMode, + ...inspectOptions })); cb(); }, items.length), @@ -31,7 +32,8 @@ function check(isTTY, colorMode, expectedColorMode) { const testConsole = new Console({ stdout: stream, ignoreErrors: false, - colorMode + colorMode, + inspectOptions }); for (const item of items) { testConsole.log(item); @@ -40,12 +42,15 @@ function check(isTTY, colorMode, expectedColorMode) { check(true, 'auto', true); check(false, 'auto', false); +check(false, undefined, true, { colors: true, compact: false }); +check(true, 'auto', true, { compact: false }); +check(true, undefined, false, { colors: false }); check(true, true, true); check(false, true, true); check(true, false, false); check(false, false, false); -// check invalid colorMode type +// Check invalid options. { const stream = new Writable({ write: common.mustNotCall() @@ -67,4 +72,24 @@ check(false, false, false); } ); }); + + [true, false, 'auto'].forEach((colorMode) => { + assert.throws( + () => { + new Console({ + stdout: stream, + ignoreErrors: false, + colorMode: colorMode, + inspectOptions: { + colors: false + } + }); + }, + { + message: 'Option "inspectOptions.color" can not be used in ' + + 'combination with option "colorMode"', + code: 'ERR_INCOMPATIBLE_OPTION_PAIR' + } + ); + }); } From 049b24d3b9af675911b09cad2cbc1b4cc967b9d8 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 17 Dec 2018 11:55:13 -0500 Subject: [PATCH 11/28] console: improve inspectOptions validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds stricter type checking to the inspectOptions option to the Console constructor. PR-URL: https://github.com/nodejs/node/pull/25090 Reviewed-By: Michaël Zasso Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- lib/internal/console/constructor.js | 4 +++- test/parallel/test-console-instance.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 89987aeec1ffd3..4d566394bfb23c 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -91,13 +91,15 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { if (typeof colorMode !== 'boolean' && colorMode !== 'auto') throw new ERR_INVALID_ARG_VALUE('colorMode', colorMode); - if (inspectOptions) { + if (typeof inspectOptions === 'object' && inspectOptions !== null) { if (inspectOptions.colors !== undefined && options.colorMode !== undefined) { throw new ERR_INCOMPATIBLE_OPTION_PAIR( 'inspectOptions.color', 'colorMode'); } optionsMap.set(this, inspectOptions); + } else if (inspectOptions !== undefined) { + throw new ERR_INVALID_ARG_TYPE('inspectOptions', 'object', inspectOptions); } // Bind the prototype functions to this Console instance diff --git a/test/parallel/test-console-instance.js b/test/parallel/test-console-instance.js index 127e59e6e5b981..1c8b54ef4ca725 100644 --- a/test/parallel/test-console-instance.js +++ b/test/parallel/test-console-instance.js @@ -128,3 +128,21 @@ out.write = err.write = (d) => {}; assert.throws(() => c2.warn('foo'), /^Error: err$/); assert.throws(() => c2.dir('foo'), /^Error: out$/); } + +// Console constructor throws if inspectOptions is not an object. +[null, true, false, 'foo', 5, Symbol()].forEach((inspectOptions) => { + assert.throws( + () => { + new Console({ + stdout: out, + stderr: err, + inspectOptions + }); + }, + { + message: 'The "inspectOptions" argument must be of type object.' + + ` Received type ${typeof inspectOptions}`, + code: 'ERR_INVALID_ARG_TYPE' + } + ); +}); From 8d166c9c972a4f675ef6ee4e5f8fb480d2b183b9 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 9 May 2018 20:42:31 +0200 Subject: [PATCH 12/28] process: provide dummy stdio for non-console Windows apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only known condition where we could not provide appropriate stdio streams so far were non-console Windows applications. Since this issue has come up a few times in our issue tracker now, switch to providing dummy streams for these cases instead. If there are other valid cases in which `uv_guess_handle` fails, and where there is a more sensible way to provide stdio, we’ll probably still find out because the streams don’t work properly either way. Refs: https://github.com/nodejs/help/issues/1251 PR-URL: https://github.com/nodejs/node/pull/20640 Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel Reviewed-By: Ben Noordhuis Reviewed-By: Luigi Pinca --- doc/api/errors.md | 36 +++++++++++++++++++------------ lib/internal/errors.js | 3 --- lib/internal/process/stdio.js | 28 ++++++++++++++++-------- test/parallel/test-dummy-stdio.js | 27 +++++++++++++++++++++++ 4 files changed, 68 insertions(+), 26 deletions(-) create mode 100644 test/parallel/test-dummy-stdio.js diff --git a/doc/api/errors.md b/doc/api/errors.md index f504acd8c02a8f..68e6955925c117 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1810,20 +1810,6 @@ An attempt was made to load a module with an unknown or unsupported format. An invalid or unknown process signal was passed to an API expecting a valid signal (such as [`subprocess.kill()`][]). - -### ERR_UNKNOWN_STDIN_TYPE - -An attempt was made to launch a Node.js process with an unknown `stdin` file -type. This error is usually an indication of a bug within Node.js itself, -although it is possible for user code to trigger it. - - -### ERR_UNKNOWN_STREAM_TYPE - -An attempt was made to launch a Node.js process with an unknown `stdout` or -`stderr` file type. This error is usually an indication of a bug within Node.js -itself, although it is possible for user code to trigger it. - ### ERR_V8BREAKITERATOR @@ -2080,6 +2066,28 @@ kind of internal Node.js error that should not typically be triggered by user code. Instances of this error point to an internal bug within the Node.js binary itself. + +### ERR_UNKNOWN_STDIN_TYPE + + +An attempt was made to launch a Node.js process with an unknown `stdin` file +type. This error is usually an indication of a bug within Node.js itself, +although it is possible for user code to trigger it. + + +### ERR_UNKNOWN_STREAM_TYPE + + +An attempt was made to launch a Node.js process with an unknown `stdout` or +`stderr` file type. This error is usually an indication of a bug within Node.js +itself, although it is possible for user code to trigger it. + ### ERR_VALUE_OUT_OF_RANGE