Fix octal string strict mode tests

This commit is contained in:
Richard van Velzen
2016-06-12 14:35:43 +02:00
parent f99b7b630d
commit 9c53c7ada7

View File

@@ -60,10 +60,10 @@ describe("String literals", function() {
it("Should not throw error outside strict mode if string contains escaped octalIntegerLiteral", function() { it("Should not throw error outside strict mode if string contains escaped octalIntegerLiteral", function() {
var tests = [ var tests = [
['"\\76";', '">";'], ['"\\76";', '">";'],
['"\\0"', '"\\x00";'], ['"\\0"', '"\\0";'],
['"\\08"', '"\\x008";'], ['"\\08"', '"\\08";'],
['"\\008"', '"\\x008";'], ['"\\008"', '"\\08";'],
['"\\0008"', '"\\x008";'], ['"\\0008"', '"\\08";'],
['"use strict" === "use strict";\n"\\76";', '"use strict"==="use strict";">";'], ['"use strict" === "use strict";\n"\\76";', '"use strict"==="use strict";">";'],
// ['"use\\\n strict";\n"\\07";', '"use\\\n strict";\n"\\u0007";'] // TODO No way to store this content literally yet as directive // ['"use\\\n strict";\n"\\07";', '"use\\\n strict";\n"\\u0007";'] // TODO No way to store this content literally yet as directive
]; ];
@@ -75,7 +75,7 @@ describe("String literals", function() {
}); });
it("Should not throw error when digit is 8 or 9", 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";"\\x008";'); 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";"\\x009";'); assert.equal(UglifyJS.parse('"use strict";"\\09"').print_to_string(), '"use strict";"\\09";');
}); });
}); });