fix Unicode handling in parser (#1884)
There was an implicit assumption that first character within surrogate header range implies the next character must form a surrogate pair, which is not necessarily true.
This commit is contained in:
@@ -135,4 +135,11 @@ describe("Unicode", function() {
|
||||
}).code, tests[i][1]);
|
||||
}
|
||||
});
|
||||
|
||||
it("Should parse raw characters correctly", function() {
|
||||
var ast = uglify.parse('console.log("\\udbff");');
|
||||
assert.strictEqual(ast.print_to_string(), 'console.log("\udbff");');
|
||||
ast = uglify.parse(ast.print_to_string());
|
||||
assert.strictEqual(ast.print_to_string(), 'console.log("\udbff");');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user