simplify
authorMihai Bazon <mihai@bazon.net>
Fri, 10 Jan 2014 08:36:15 +0000 (10:36 +0200)
committerMihai Bazon <mihai@bazon.net>
Fri, 10 Jan 2014 08:36:15 +0000 (10:36 +0200)
lib/output.js

index f778b38..37200c4 100644 (file)
@@ -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("\\\\");