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:
Alex Lam S.L
2017-05-09 01:58:31 +08:00
committed by GitHub
parent 3fac29a017
commit 2433bb4e52
4 changed files with 23 additions and 17 deletions

View File

@@ -212,7 +212,7 @@ function run() {
fatal("ERROR: " + ex.message);
}
if (program.output == "spidermonkey") {
console.log(JSON.stringify(UglifyJS.parse(new Buffer(result.code).toString()).to_mozilla_ast(), null, 2));
console.log(JSON.stringify(UglifyJS.parse(result.code).to_mozilla_ast(), null, 2));
} else if (program.output) {
fs.writeFileSync(program.output, result.code);
if (result.map) {