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:
Antoine du Hamel authored and Beth Griggs committed 2020-12-15 20:15:12 +00:00
1 parent 3a08afc402
commit 3e7598da9b
1 file changed
+5 -3
+5 -3
View File
@@ -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