diff --git a/acorn.js b/acorn.js index 3aa7f661c7..9fdcf0ca6c 100644 --- a/acorn.js +++ b/acorn.js @@ -3147,7 +3147,11 @@ } else // export default ...; if (eat(_default)) { - node.declaration = parseExpression(true); + if (tokType === _function || tokType === _class) { + node.declaration = parseStatement(); + } else { + node.declaration = parseExpression(true); + } node['default'] = true; node.specifiers = null; node.source = null;