rename loose modules

This commit is contained in:
Sebastian McKenzie 2015-01-25 15:46:27 +11:00
parent d8046333c0
commit 456bce1c9a
2 changed files with 4 additions and 2 deletions

View File

@ -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
};

View File

@ -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,