From bc307c4559081c16ca43979ce8b6f10f762c0852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Santos?= Date: Mon, 19 Mar 2018 16:46:18 +0000 Subject: [PATCH] enable sourceType:module in acorn when necessary --- bin/uglifyjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/uglifyjs b/bin/uglifyjs index 41bdef2b..9adc0c1c 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -197,7 +197,8 @@ function run() { return require("acorn").parse(files[name], { locations: true, program: toplevel, - sourceFile: name + sourceFile: name, + sourceType: options.module || program.parse.module ? "module" : "script" }); }); } else if (program.parse.spidermonkey) {