From 9d3580b23ac6e5a55013339c3b13cde5c6a6072b Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 29 Oct 2014 20:35:37 +1100 Subject: [PATCH] make ImportDeclaration and ExportDeclaration semicolons more spec-compliant --- acorn.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acorn.js b/acorn.js index 8013c92685..401b9421c8 100644 --- a/acorn.js +++ b/acorn.js @@ -2482,8 +2482,8 @@ node.source = null; semicolon(); } else { - // export * from '...' - // export { x, y as z } [from '...'] + // export * from '...'; + // export { x, y as z } [from '...']; var isBatch = tokType === _star; node.declaration = null; node['default'] = false; @@ -2495,6 +2495,7 @@ if (isBatch) unexpected(); node.source = null; } + semicolon(); } return finishNode(node, "ExportDeclaration"); } @@ -2549,6 +2550,7 @@ // (it doesn't support mixed default + named yet) node.kind = node.specifiers[0]['default'] ? "default" : "named"; } + semicolon(); return finishNode(node, "ImportDeclaration"); }