mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
repl: document top level await limitation with const/let
Fixes: https://github.com/nodejs/node/issues/17669 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/38449 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
@@ -233,6 +233,23 @@ undefined
|
||||
undefined
|
||||
```
|
||||
|
||||
One known limitation of using the `await` keyword in the REPL is that
|
||||
it will invalidate the lexical scoping of the `const` and `let`
|
||||
keywords.
|
||||
|
||||
For example:
|
||||
|
||||
```console
|
||||
> const m = await Promise.resolve(123)
|
||||
undefined
|
||||
> m
|
||||
123
|
||||
> const m = await Promise.resolve(234)
|
||||
undefined
|
||||
> m
|
||||
234
|
||||
```
|
||||
|
||||
### Reverse-i-search
|
||||
<!-- YAML
|
||||
added:
|
||||
|
||||
Reference in New Issue
Block a user