From 456bce1c9a3a1a26c94c591a645042f83e50f44c Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 25 Jan 2015 15:46:27 +1100 Subject: [PATCH] rename loose modules --- lib/6to5/file.js | 4 +++- lib/6to5/util.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/6to5/file.js b/lib/6to5/file.js index d2888b199b..c4764c3a1b 100644 --- a/lib/6to5/file.js +++ b/lib/6to5/file.js @@ -300,7 +300,8 @@ File.prototype.parse = function (code) { code = this.addCode(code); var opts = this.opts; - opts.looseModules = this.isLoose("modules"); + + opts.allowImportExportEverywhere = this.isLoose("modules"); return util.parse(opts, code, function (tree) { self.transform(tree); @@ -337,6 +338,7 @@ File.prototype.generate = function () { var result = { code: "", + opts: opts, map: null, ast: null }; diff --git a/lib/6to5/util.js b/lib/6to5/util.js index c5b33284be..dc77192d81 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -222,7 +222,7 @@ exports.parse = function (opts, code, callback) { var tokens = []; var ast = acorn.parse(code, { - allowImportExportEverywhere: opts.looseModules, + allowImportExportEverywhere: opts.allowImportExportEverywhere, allowReturnOutsideFunction: true, ecmaVersion: opts.experimental ? 7 : 6, playground: opts.playground,