diff options
author | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2017-08-14 00:30:08 -0400 |
---|---|---|
committer | Alex Lam S.L <alexlamsl@gmail.com> | 2017-08-14 12:30:08 +0800 |
commit | 16d40915b480c38b9ef359223cd4f46146eb36c0 (patch) | |
tree | f865cc4e4850e404d6ba424f36d44259b3fe799d /test/mocha/string-literal.js | |
parent | e7c21e87e3a3d1c9700941ecdf97a2a50fa2ae66 (diff) | |
download | tracifyjs-16d40915b480c38b9ef359223cd4f46146eb36c0.tar.gz tracifyjs-16d40915b480c38b9ef359223cd4f46146eb36c0.zip |
don't escape null characters as \0 when followed by any digit (#2273)
fixes #2272
Diffstat (limited to 'test/mocha/string-literal.js')
-rw-r--r-- | test/mocha/string-literal.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/mocha/string-literal.js b/test/mocha/string-literal.js index d2eb6a80..f595f29a 100644 --- a/test/mocha/string-literal.js +++ b/test/mocha/string-literal.js @@ -61,9 +61,9 @@ describe("String literals", function() { var tests = [ ['"\\76";', ';">";'], ['"\\0"', '"\\0";'], - ['"\\08"', '"\\08";'], - ['"\\008"', '"\\08";'], - ['"\\0008"', '"\\08";'], + ['"\\08"', '"\\x008";'], + ['"\\008"', '"\\x008";'], + ['"\\0008"', '"\\x008";'], ['"use strict" === "use strict";\n"\\76";', '"use strict"==="use strict";">";'], ['"use\\\n strict";\n"\\07";', ';"use strict";"\07";'] ]; @@ -75,8 +75,8 @@ describe("String literals", function() { }); it("Should not throw error when digit is 8 or 9", function() { - assert.equal(UglifyJS.parse('"use strict";"\\08"').print_to_string(), '"use strict";"\\08";'); - assert.equal(UglifyJS.parse('"use strict";"\\09"').print_to_string(), '"use strict";"\\09";'); + assert.equal(UglifyJS.parse('"use strict";"\\08"').print_to_string(), '"use strict";"\\x008";'); + assert.equal(UglifyJS.parse('"use strict";"\\09"').print_to_string(), '"use strict";"\\x009";'); }); it("Should not unescape unpaired surrogates", function() { |