From 556a34ba3470cb187fbf0c288dae197f174915d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Santos?= Date: Sun, 25 Mar 2018 20:35:12 +0100 Subject: [PATCH] add mocha test --- test/mocha/spidermonkey.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/mocha/spidermonkey.js b/test/mocha/spidermonkey.js index ccd11c43..756a2f43 100644 --- a/test/mocha/spidermonkey.js +++ b/test/mocha/spidermonkey.js @@ -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 = [ {