Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 620ee42

Browse filesBrowse files
jasnelltargos
authored andcommitted
repl: document top level await limitation with const/let
Fixes: #17669 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #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>
1 parent a0c566f commit 620ee42
Copy full SHA for 620ee42

File tree

Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/repl.md‎

Copy file name to clipboardExpand all lines: doc/api/repl.md
+17Lines changed: 17 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,23 @@ undefined
233233
undefined
234234
```
235235

236+
One known limitation of using the `await` keyword in the REPL is that
237+
it will invalidate the lexical scoping of the `const` and `let`
238+
keywords.
239+
240+
For example:
241+
242+
```console
243+
> const m = await Promise.resolve(123)
244+
undefined
245+
> m
246+
123
247+
> const m = await Promise.resolve(234)
248+
undefined
249+
> m
250+
234
251+
```
252+
236253
### Reverse-i-search
237254
<!-- YAML
238255
added:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.