From 6ca7b7bcddd3de2d760b2bb7c92ab89234dd2564 Mon Sep 17 00:00:00 2001 From: cola119 Date: Tue, 21 Jun 2022 12:27:56 +0900 Subject: [PATCH 1/2] test: add test to ensure repl doesn't support --input-type --- test/parallel/test-repl-unsupported-option.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/parallel/test-repl-unsupported-option.js diff --git a/test/parallel/test-repl-unsupported-option.js b/test/parallel/test-repl-unsupported-option.js new file mode 100644 index 00000000000000..c5b234614983f6 --- /dev/null +++ b/test/parallel/test-repl-unsupported-option.js @@ -0,0 +1,10 @@ +'use strict'; + +require('../common'); + +const assert = require('assert'); +const { spawnSync } = require('child_process'); + +const result = spawnSync(process.execPath, ['-i', '--input-type=module']); + +assert.match(result.stderr.toString(), /Cannot specify --input-type for REPL/); From 96429ccf5a326ca3cdb79443ad039d515673eaec Mon Sep 17 00:00:00 2001 From: cola119 Date: Tue, 21 Jun 2022 12:44:29 +0900 Subject: [PATCH 2/2] doc: improve description of --input-type --- doc/api/cli.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index 07969b6dd91b11..1e618b1d530497 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -597,6 +597,8 @@ module. String input is input via `--eval`, `--print`, or `STDIN`. Valid values are `"commonjs"` and `"module"`. The default is `"commonjs"`. +The REPL does not support this option. + ### `--inspect-brk[=[host:]port]`