patch export default within sandbox correctly (#5346)

fixes #5345
This commit is contained in:
Alex Lam S.L
2022-02-10 08:07:40 +00:00
committed by GitHub
parent b6c72c84d4
commit 33c163f648
4 changed files with 569 additions and 538 deletions

View File

@@ -434,4 +434,18 @@ describe("test/reduce.js", function() {
"// }",
].join("\n"));
});
it("Should transform `export default` correctly", function() {
var result = reduce_test(read("test/input/reduce/export_default.js"), {
compress: false,
toplevel: true,
});
if (result.error) throw result.error;
assert.strictEqual(result.code, [
"// Can't reproduce test failure",
"// minify options: {",
'// "compress": false,',
'// "toplevel": true',
"// }",
].join("\n"));
});
});