From fbb150cfc18039b8584078119ceef35d6ef9f74a Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 13 Jan 2015 00:10:12 +1100 Subject: [PATCH] remove allowImportExportEverywhere --- CHANGELOG.md | 5 +++++ lib/6to5/util.js | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a1c2128f2..5106b0a3cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ _Note: Gaps between patch versions are faulty/broken releases._ +## 3.0.0 + + * **Breaking Change** + * `allowImportExportEverywhere` acorn option has been disabled for spec compliancy so imports and exports can **only** be present at the top level. + ## 2.10.1 * **Internal** diff --git a/lib/6to5/util.js b/lib/6to5/util.js index d161eec184..0affe7dab0 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -216,15 +216,14 @@ exports.parse = function (opts, code, callback) { var tokens = []; var ast = acorn.parse(code, { - allowImportExportEverywhere: true, - allowReturnOutsideFunction: true, - ecmaVersion: opts.experimental ? 7 : 6, - playground: opts.playground, - strictMode: true, - onComment: comments, - locations: true, - onToken: tokens, - ranges: true + allowReturnOutsideFunction: true, + ecmaVersion: opts.experimental ? 7 : 6, + playground: opts.playground, + strictMode: true, + onComment: comments, + locations: true, + onToken: tokens, + ranges: true }); estraverse.attachComments(ast, comments, tokens);