fix line terminators in template literals (#2173)

fixes #2172
This commit is contained in:
Alex Lam S.L
2017-06-28 22:52:29 +08:00
committed by GitHub
parent 4d5aeeddfb
commit d052394621
3 changed files with 16 additions and 4 deletions

View File

@@ -30,4 +30,13 @@ describe("Template string", function() {
assert.throws(exec(tests[i]), fail, tests[i]);
}
});
it("Should process all line terminators as LF", function() {
[
"`a\rb`",
"`a\nb`",
"`a\r\nb`",
].forEach(function(code) {
assert.strictEqual(uglify.parse(code).print_to_string(), "`a\\nb`;");
});
});
});