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);
|
code = this.addCode(code);
|
||||||
|
|
||||||
var opts = this.opts;
|
var opts = this.opts;
|
||||||
opts.looseModules = this.isLoose("modules");
|
|
||||||
|
opts.allowImportExportEverywhere = this.isLoose("modules");
|
||||||
|
|
||||||
return util.parse(opts, code, function (tree) {
|
return util.parse(opts, code, function (tree) {
|
||||||
self.transform(tree);
|
self.transform(tree);
|
||||||
@ -337,6 +338,7 @@ File.prototype.generate = function () {
|
|||||||
|
|
||||||
var result = {
|
var result = {
|
||||||
code: "",
|
code: "",
|
||||||
|
opts: opts,
|
||||||
map: null,
|
map: null,
|
||||||
ast: null
|
ast: null
|
||||||
};
|
};
|
||||||
|
|||||||
@ -222,7 +222,7 @@ exports.parse = function (opts, code, callback) {
|
|||||||
var tokens = [];
|
var tokens = [];
|
||||||
|
|
||||||
var ast = acorn.parse(code, {
|
var ast = acorn.parse(code, {
|
||||||
allowImportExportEverywhere: opts.looseModules,
|
allowImportExportEverywhere: opts.allowImportExportEverywhere,
|
||||||
allowReturnOutsideFunction: true,
|
allowReturnOutsideFunction: true,
|
||||||
ecmaVersion: opts.experimental ? 7 : 6,
|
ecmaVersion: opts.experimental ? 7 : 6,
|
||||||
playground: opts.playground,
|
playground: opts.playground,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user