Skip to content

Commit 5436dc5

Browse files
committed
Solve a bug from espree.
1 parent 0b4ae46 commit 5436dc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/loaders/node_loader/bootstrap/lib/bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ function node_loader_trampoline_discover_function(func) {
266266
if (node_loader_trampoline_is_callable(func)) {
267267
// Espree can't parse native code functions so we can do a workaround
268268
const str = func.toString().replace('{ [native code] }', '{}');
269-
const ast = espree.parse(str, {
270-
ecmaVersion: 13
269+
const ast = espree.parse(`(${str})`, {
270+
ecmaVersion: 14
271271
});
272272

273273
const node = (ast.body[0].type === 'ExpressionStatement') ?

0 commit comments

Comments
 (0)