Fix export default functions and classes being parsed as expressions instead of declarations
This commit is contained in:
parent
9d3580b23a
commit
0bea7c9d51
6
acorn.js
6
acorn.js
@ -2476,7 +2476,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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user