Skip to content

Commit ce1f2d5

Browse files
committed
fixup! repl: hide top-level await feature behind a flag
1 parent d8d5c2a commit ce1f2d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/api/repl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ experimental support for the `await` keyword is enabled.
191191
> await Promise.reject(new Error('REPL await'))
192192
Error: REPL await
193193
at repl:1:45
194-
> timeout = util.promisify(setTimeout)
194+
> const timeout = util.promisify(setTimeout)
195195
[Function]
196-
> old = Date.now(); await timeout(1000); console.log(Date.now() - old);
196+
> const old = Date.now(); await timeout(1000); console.log(Date.now() - old);
197197
1002
198198
undefined
199199
```

lib/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function REPLServer(prompt,
231231

232232
if (experimentalREPLAwait && code.includes('await')) {
233233
if (processTopLevelAwait === undefined)
234-
({ processTopLevelAwait } = require('internal/repl/await'));
234+
;({ processTopLevelAwait } = require('internal/repl/await'));
235235

236236
const potentialWrappedCode = processTopLevelAwait(code);
237237
if (potentialWrappedCode !== null) {

0 commit comments

Comments
 (0)