fix corner case in inline & module (#5492)

fixes #5491
This commit is contained in:
Alex Lam S.L
2022-06-06 15:52:22 +01:00
committed by GitHub
parent 00665766da
commit 0c7b016fa7
4 changed files with 41 additions and 11 deletions

View File

@@ -2517,8 +2517,11 @@ for (var round = 1; round <= num_iterations; round++) {
})) continue;
minify_options.forEach(function(options) {
var o = JSON.parse(options);
if (async && has_await) {
o.module = true;
options = JSON.stringify(o);
}
var toplevel = sandbox.has_toplevel(o);
if (async && has_await) o.parse = { module: true };
o.validate = true;
uglify_code = UglifyJS.minify(original_code, o);
original_result = orig_result[toplevel ? 1 : 0];