diff --git a/lib/internal/repl/await.js b/lib/internal/repl/await.js index ac0445311b7ba9..6fb10bbba0d2b8 100644 --- a/lib/internal/repl/await.js +++ b/lib/internal/repl/await.js @@ -4,6 +4,23 @@ const { Object } = primordials; const acorn = require('internal/deps/acorn/acorn/dist/acorn'); const walk = require('internal/deps/acorn/acorn-walk/dist/walk'); +const privateMethods = + require('internal/deps/acorn-plugins/acorn-private-methods/index'); +const bigInt = require('internal/deps/acorn-plugins/acorn-bigint/index'); +const classFields = + require('internal/deps/acorn-plugins/acorn-class-fields/index'); +const numericSeparator = + require('internal/deps/acorn-plugins/acorn-numeric-separator/index'); +const staticClassFeatures = + require('internal/deps/acorn-plugins/acorn-static-class-features/index'); + +const parser = acorn.Parser.extend( + privateMethods, + bigInt, + classFields, + numericSeparator, + staticClassFeatures +); const noop = () => {}; const visitorsWithoutAncestors = { @@ -76,7 +93,7 @@ function processTopLevelAwait(src) { const wrappedArray = wrapped.split(''); let root; try { - root = acorn.parse(wrapped, { ecmaVersion: 10 }); + root = parser.parse(wrapped, { ecmaVersion: 10 }); } catch { return null; }