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 — assert,repl: enable ecmaVersion 2021 in acorn parser · nodejs/node@a9d3a0d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • assert.js
    • internal/repl
      • await.js
      • utils.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/assert.js‎

Copy file name to clipboardExpand all lines: lib/assert.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function parseCode(code, offset) {
239239
// Parse the read code until the correct expression is found.
240240
do {
241241
try {
242-
node = parseExpressionAt(code, start, { ecmaVersion: 11 });
242+
node = parseExpressionAt(code, start, { ecmaVersion: 'latest' });
243243
start = node.end + 1 || start;
244244
// Find the CallExpression in the tree.
245245
node = findNodeAround(node, offset, 'CallExpression');
Collapse file

‎lib/internal/repl/await.js‎

Copy file name to clipboardExpand all lines: lib/internal/repl/await.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function processTopLevelAwait(src) {
9090
const wrappedArray = wrapped.split('');
9191
let root;
9292
try {
93-
root = parser.parse(wrapped, { ecmaVersion: 11 });
93+
root = parser.parse(wrapped, { ecmaVersion: 'latest' });
9494
} catch {
9595
return null;
9696
}
Collapse file

‎lib/internal/repl/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/repl/utils.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function isRecoverableError(e, code) {
114114
// Try to parse the code with acorn. If the parse fails, ignore the acorn
115115
// error and return the recoverable status.
116116
try {
117-
RecoverableParser.parse(code, { ecmaVersion: 11 });
117+
RecoverableParser.parse(code, { ecmaVersion: 'latest' });
118118

119119
// Odd case: the underlying JS engine (V8, Chakra) rejected this input
120120
// but Acorn detected no issue. Presume that additional text won't

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.