diff options
author | Fábio Santos <fabiosantosart@gmail.com> | 2018-03-26 19:22:01 +0100 |
---|---|---|
committer | Alex Lam S.L <alexlamsl@gmail.com> | 2018-03-27 03:22:01 +0900 |
commit | 9a5e2052c4860256021ede7c2c5d529fa0f320ed (patch) | |
tree | ed3ede8fa663feffd2f0e19ea0857d78a1350715 /test/mocha | |
parent | b1410be443e5ebce98a0a4438da9a8c9618e18fc (diff) | |
download | tracifyjs-9a5e2052c4860256021ede7c2c5d529fa0f320ed.tar.gz tracifyjs-9a5e2052c4860256021ede7c2c5d529fa0f320ed.zip |
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.
Diffstat (limited to 'test/mocha')
-rw-r--r-- | test/mocha/spidermonkey.js | 9 |
1 files changed, 9 insertions, 0 deletions
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 = [ { |