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
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/assert.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -239,7 +239,7 @@ function parseCode(code, offset) { |
239 | 239 | // Parse the read code until the correct expression is found. |
240 | 240 | do { |
241 | 241 | try { |
242 | | - node = parseExpressionAt(code, start, { ecmaVersion: 11 }); |
| 242 | + node = parseExpressionAt(code, start, { ecmaVersion: 'latest' }); |
243 | 243 | start = node.end + 1 || start; |
244 | 244 | // Find the CallExpression in the tree. |
245 | 245 | node = findNodeAround(node, offset, 'CallExpression'); |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/repl/await.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -90,7 +90,7 @@ function processTopLevelAwait(src) { |
90 | 90 | const wrappedArray = wrapped.split(''); |
91 | 91 | let root; |
92 | 92 | try { |
93 | | - root = parser.parse(wrapped, { ecmaVersion: 11 }); |
| 93 | + root = parser.parse(wrapped, { ecmaVersion: 'latest' }); |
94 | 94 | } catch { |
95 | 95 | return null; |
96 | 96 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/repl/utils.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -114,7 +114,7 @@ function isRecoverableError(e, code) { |
114 | 114 | // Try to parse the code with acorn. If the parse fails, ignore the acorn |
115 | 115 | // error and return the recoverable status. |
116 | 116 | try { |
117 | | - RecoverableParser.parse(code, { ecmaVersion: 11 }); |
| 117 | + RecoverableParser.parse(code, { ecmaVersion: 'latest' }); |
118 | 118 |
|
119 | 119 | // Odd case: the underlying JS engine (V8, Chakra) rejected this input |
120 | 120 | // but Acorn detected no issue. Presume that additional text won't |
|