only set strictMode to true when the useStrict transformer is enabled
This commit is contained in:
@@ -316,6 +316,7 @@ File.prototype.parse = function (code) {
|
||||
var opts = this.opts;
|
||||
|
||||
opts.allowImportExportEverywhere = this.isLoose("es6.modules");
|
||||
opts.strictMode = this.transformers.useStrict.canRun();
|
||||
|
||||
return util.parse(opts, code, function (tree) {
|
||||
self.transform(tree);
|
||||
|
||||
@@ -204,7 +204,7 @@ exports.parse = function (opts, code, callback) {
|
||||
allowReturnOutsideFunction: true,
|
||||
ecmaVersion: opts.experimental ? 7 : 6,
|
||||
playground: opts.playground,
|
||||
strictMode: true,
|
||||
strictMode: opts.strictMode,
|
||||
onComment: comments,
|
||||
locations: true,
|
||||
onToken: tokens,
|
||||
|
||||
Reference in New Issue
Block a user