fix extra regex slash when going through mozilla AST I/O (#3025)

This relates to #1929, but in the context of mozilla AST input/output.
This commit is contained in:
Fábio Santos
2018-03-26 19:22:01 +01:00
committed by Alex Lam S.L
parent b1410be443
commit 9a5e2052c4
2 changed files with 25 additions and 14 deletions

View File

@@ -23,6 +23,15 @@ describe("spidermonkey export/import sanity test", function() {
});
});
it("should not add unnecessary escape slashes to regexps", function() {
var input = "/[\\\\/]/;";
var ast = uglify.parse(input).to_mozilla_ast();
assert.equal(
uglify.AST_Node.from_mozilla_ast(ast).print_to_string(),
input
);
});
it("Should judge between directives and strings correctly on import", function() {
var tests = [
{