aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2014-01-10 10:36:15 +0200
committerMihai Bazon <mihai@bazon.net>2014-01-10 10:36:15 +0200
commit90a330da16e77b8836ea8f02d6733618e6c23374 (patch)
treefff43e2b0a2745ddd6ff3df9211ddc38e5f64489
parentcad1f9cbd112b1117562b942f39a1205e00e2bf0 (diff)
downloadtracifyjs-90a330da16e77b8836ea8f02d6733618e6c23374.tar.gz
tracifyjs-90a330da16e77b8836ea8f02d6733618e6c23374.zip
simplify
-rw-r--r--lib/output.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/output.js b/lib/output.js
index f778b381..37200c40 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -1124,8 +1124,8 @@ function OutputStream(options) {
str = output.to_ascii(str);
} else {
str = str.split("\\\\").map(function(str){
- return str.replace(/(\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2})/g, function(s, p1){
- var code = parseInt(p1.substr(2), 16);
+ return str.replace(/\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}/g, function(s){
+ var code = parseInt(s.substr(2), 16);
return code == 10 || code == 13 || code == 0x2028 || code == 0x2029 ? s : String.fromCharCode(code);
});
}).join("\\\\");