From 3e7598da9bc328e7cfba008eb32c6e1b4e208721 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 6 Nov 2020 13:08:30 +0100 Subject: [PATCH] tools,doc: enable ecmaVersion 2021 in acorn parser PR-URL: https://github.com/nodejs/node/pull/35994 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott Reviewed-By: Jiawen Geng Reviewed-By: Derek Lewis Reviewed-By: Luigi Pinca --- tools/doc/apilinks.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/doc/apilinks.js b/tools/doc/apilinks.js index 461805dac3a811..c9ce87ba08ad48 100644 --- a/tools/doc/apilinks.js +++ b/tools/doc/apilinks.js @@ -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