GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — repl: document top level await limitation with const/let · nodejs/node@620ee42

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • repl.md
Expand file treeCollapse file tree
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)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.