mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
tools,doc: enable ecmaVersion 2021 in acorn parser
PR-URL: https://github.com/nodejs/node/pull/35994 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
3a08afc402
commit
3e7598da9b
1 file changed
+5
-3
@@ -54,9 +54,11 @@ inputs.forEach((file) => {
|
||||
|
||||
// Parse source.
|
||||
const source = fs.readFileSync(file, 'utf8');
|
||||
const ast = acorn.parse(
|
||||
source,
|
||||
{ allowReturnOutsideFunction: true, ecmaVersion: 10, locations: true });
|
||||
const ast = acorn.parse(source, {
|
||||
allowReturnOutsideFunction: true,
|
||||
ecmaVersion: 'latest',
|
||||
locations: true,
|
||||
});
|
||||
const program = ast.body;
|
||||
|
||||
// Build link
|
||||
|
||||
Reference in new issue
Block a user