Skip to content

Commit 4f844f4

Browse files
committed
repl: use inspector over vm
Signed-off-by: Aviv Keller <me@aviv.sh> PR-URL: #64034 Fixes: #64523 Closes: #64534 Fixes: #39387 Closes: #39392 Fixes: #61390 Fixes: #63126 Fixes: #38503 Fixes: #37445 Fixes: #38145 Fixes: #33369 Fixes: #48131 Fixes: #8309 Fixes: #39689 Fixes: #18931 Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 39f427d commit 4f844f4

129 files changed

Lines changed: 3276 additions & 4359 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/api/cli.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,14 +2079,6 @@ added: v21.2.0
20792079
20802080
Disable exposition of [Navigator API][] on the global scope.
20812081

2082-
### `--no-experimental-repl-await`
2083-
2084-
<!-- YAML
2085-
added: v16.6.0
2086-
-->
2087-
2088-
Use this flag to disable top-level await in REPL.
2089-
20902082
### `--no-experimental-require-module`
20912083

20922084
<!-- YAML
@@ -3866,7 +3858,6 @@ one is included in the list below.
38663858
* `--no-async-context-frame`
38673859
* `--no-deprecation`
38683860
* `--no-experimental-global-navigator`
3869-
* `--no-experimental-repl-await`
38703861
* `--no-experimental-sqlite`
38713862
* `--no-experimental-strip-types`
38723863
* `--no-experimental-websocket`

doc/api/errors.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,6 @@ An operation outside the bounds of a `Buffer` was attempted.
768768
An attempt has been made to create a `Buffer` larger than the maximum allowed
769769
size.
770770

771-
<a id="ERR_CANNOT_WATCH_SIGINT"></a>
772-
773-
### `ERR_CANNOT_WATCH_SIGINT`
774-
775-
Node.js was unable to watch for the `SIGINT` signal.
776-
777771
<a id="ERR_CHILD_CLOSED_BEFORE_REPLY"></a>
778772

779773
### `ERR_CHILD_CLOSED_BEFORE_REPLY`
@@ -2144,13 +2138,6 @@ An invalid `options.protocol` was passed to `http.request()`.
21442138
Both `breakEvalOnSigint` and `eval` options were set in the [`REPL`][] config,
21452139
which is not supported.
21462140

2147-
<a id="ERR_INVALID_REPL_INPUT"></a>
2148-
2149-
### `ERR_INVALID_REPL_INPUT`
2150-
2151-
The input may not be used in the [`REPL`][]. The conditions under which this
2152-
error is used are described in the [`REPL`][] documentation.
2153-
21542141
<a id="ERR_INVALID_RETURN_PROPERTY"></a>
21552142

21562143
### `ERR_INVALID_RETURN_PROPERTY`

doc/api/repl.md

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -170,39 +170,6 @@ global or scoped variable, the input `fs` will be evaluated on-demand as
170170
> fs.createReadStream('./some/file');
171171
```
172172

173-
#### Global uncaught exceptions
174-
175-
<!-- YAML
176-
changes:
177-
- version: v12.3.0
178-
pr-url: https://github.com/nodejs/node/pull/27151
179-
description: The `'uncaughtException'` event is from now on triggered if the
180-
repl is used as standalone program.
181-
-->
182-
183-
The REPL uses the [`domain`][] module to catch all uncaught exceptions for that
184-
REPL session.
185-
186-
This use of the [`domain`][] module in the REPL has these side effects:
187-
188-
* Uncaught exceptions only emit the [`'uncaughtException'`][] event in the
189-
standalone REPL. Adding a listener for this event in a REPL within
190-
another Node.js program results in [`ERR_INVALID_REPL_INPUT`][].
191-
192-
```js
193-
const r = repl.start();
194-
195-
r.write('process.on("uncaughtException", () => console.log("Foobar"));\n');
196-
// Output stream includes:
197-
// TypeError [ERR_INVALID_REPL_INPUT]: Listeners for `uncaughtException`
198-
// cannot be used in the REPL
199-
200-
r.close();
201-
```
202-
203-
* Trying to use [`process.setUncaughtExceptionCaptureCallback()`][] throws
204-
an [`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`][] error.
205-
206173
#### Assignment of the `_` (underscore) variable
207174

208175
<!-- YAML
@@ -242,6 +209,14 @@ Uncaught Error: foo
242209

243210
#### `await` keyword
244211

212+
<!-- YAML
213+
changes:
214+
- version: REPLACEME
215+
pr-url: https://github.com/nodejs/node/pull/64034
216+
description: The `--experimental-repl-await` flag was removed. Top-level
217+
`await` is always enabled and can no longer be disabled.
218+
-->
219+
245220
Support for the `await` keyword is enabled at the top level.
246221

247222
```console
@@ -257,25 +232,6 @@ undefined
257232
undefined
258233
```
259234

260-
One known limitation of using the `await` keyword in the REPL is that
261-
it will invalidate the lexical scoping of the `const` keywords.
262-
263-
For example:
264-
265-
```console
266-
> const m = await Promise.resolve(123)
267-
undefined
268-
> m
269-
123
270-
> m = await Promise.resolve(234)
271-
234
272-
// redeclaring the constant does error
273-
> const m = await Promise.resolve(345)
274-
Uncaught SyntaxError: Identifier 'm' has already been declared
275-
```
276-
277-
[`--no-experimental-repl-await`][] shall disable top-level await in REPL.
278-
279235
### Reverse-i-search
280236

281237
<!-- YAML
@@ -1174,15 +1130,10 @@ Original code from <https://gist.github.com/TooTallNate/2053342>.
11741130
[TTY keybindings]: readline.md#tty-keybindings
11751131
[ZSH]: https://en.wikipedia.org/wiki/Z_shell
11761132
[`'uncaughtException'`]: process.md#event-uncaughtexception
1177-
[`--no-experimental-repl-await`]: cli.md#--no-experimental-repl-await
1178-
[`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.md#err_domain_cannot_set_uncaught_exception_capture
1179-
[`ERR_INVALID_REPL_INPUT`]: errors.md#err_invalid_repl_input
11801133
[`curl()`]: https://curl.haxx.se/docs/manpage.html
1181-
[`domain`]: domain.md
11821134
[`module.builtinModules`]: module.md#modulebuiltinmodules
11831135
[`net.Server`]: net.md#class-netserver
11841136
[`net.Socket`]: net.md#class-netsocket
1185-
[`process.setUncaughtExceptionCaptureCallback()`]: process.md#processsetuncaughtexceptioncapturecallbackfn
11861137
[`readline.InterfaceCompleter`]: readline.md#use-of-the-completer-function
11871138
[`repl.ReplServer`]: #class-replserver
11881139
[`repl.start()`]: #replstartoptions

doc/node-config-schema.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,6 @@
244244
"type": "boolean",
245245
"description": "Print pending top-level await. If --require-module is true, evaluate asynchronous graphs loaded by `require()` but do not run the microtasks, in order to find and print top-level await in the graph"
246246
},
247-
"experimental-repl-await": {
248-
"type": "boolean",
249-
"description": "experimental await keyword support in REPL"
250-
},
251247
"experimental-require-module": {
252248
"type": "boolean",
253249
"description": "Legacy alias for --require-module"

doc/node.1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,6 @@ Disable using syntax detection to determine module type.
10931093
.It Fl -no-experimental-global-navigator
10941094
Disable exposition of Navigator API on the global scope.
10951095
.
1096-
.It Fl -no-experimental-repl-await
1097-
Use this flag to disable top-level await in REPL.
1098-
.
10991096
.It Fl -no-experimental-require-module
11001097
Legacy alias for \fB--no-require-module\fR.
11011098
.
@@ -2050,8 +2047,6 @@ one is included in the list below.
20502047
.It
20512048
\fB--no-experimental-global-navigator\fR
20522049
.It
2053-
\fB--no-experimental-repl-await\fR
2054-
.It
20552050
\fB--no-experimental-sqlite\fR
20562051
.It
20572052
\fB--no-experimental-strip-types\fR

lib/internal/errors.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,6 @@ E('ERR_BUFFER_OUT_OF_BOUNDS',
11571157
E('ERR_BUFFER_TOO_LARGE',
11581158
'Cannot create a Buffer larger than %s bytes',
11591159
RangeError);
1160-
E('ERR_CANNOT_WATCH_SIGINT', 'Cannot watch for SIGINT signals', Error);
11611160
E('ERR_CHILD_CLOSED_BEFORE_REPLY',
11621161
'Child closed before reply received', Error);
11631162
E('ERR_CHILD_PROCESS_IPC_REQUIRED',
@@ -1544,7 +1543,6 @@ E('ERR_INVALID_PROTOCOL',
15441543
TypeError);
15451544
E('ERR_INVALID_REPL_EVAL_CONFIG',
15461545
'Cannot specify both "breakEvalOnSigint" and "eval" for REPL', TypeError);
1547-
E('ERR_INVALID_REPL_INPUT', '%s', TypeError);
15481546
E('ERR_INVALID_RETURN_PROPERTY', (input, name, prop, value) => {
15491547
return `Expected a valid ${input} to be returned for the "${prop}" from the` +
15501548
` "${name}" hook but got ${determineSpecificType(value)}.`;

0 commit comments

Comments
 (0)