rename loose modules
This commit is contained in:
parent
d8046333c0
commit
456bce1c9a
@ -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
|
||||
};
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user