aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/comments.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/mocha/comments.js')
-rw-r--r--test/mocha/comments.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/mocha/comments.js b/test/mocha/comments.js
index 764f6db8..9a4b3be6 100644
--- a/test/mocha/comments.js
+++ b/test/mocha/comments.js
@@ -259,6 +259,30 @@ describe("comments", function() {
assert.strictEqual(result.code, code);
});
+ it("Should handle comments around parenthesis correctly", function() {
+ var code = [
+ "a();",
+ "/* foo */",
+ "(b())",
+ "/* bar */",
+ "c();",
+ ].join("\n");
+ var result = UglifyJS.minify(code, {
+ compress: false,
+ mangle: false,
+ output: {
+ comments: "all",
+ },
+ });
+ if (result.error) throw result.error;
+ assert.strictEqual(result.code, [
+ "a();",
+ "/* foo */",
+ "b()",
+ "/* bar */;c();",
+ ].join("\n"));
+ });
+
it("Should preserve comments around IIFE", function() {
var result = UglifyJS.minify("/*a*/(/*b*/function(){/*c*/}/*d*/)/*e*/();", {
compress: false,