don't escape null characters as \0 when followed by any digit (#2273)

fixes #2272
This commit is contained in:
Erik Desjardins
2017-08-14 00:30:08 -04:00
committed by Alex Lam S.L
parent e7c21e87e3
commit 16d40915b4
4 changed files with 9 additions and 9 deletions

View File

@@ -146,7 +146,7 @@ function OutputStream(options) {
case "\u2029": return "\\u2029";
case "\ufeff": return "\\ufeff";
case "\0":
return /[0-7]/.test(str.charAt(i+1)) ? "\\x00" : "\\0";
return /[0-9]/.test(str.charAt(i+1)) ? "\\x00" : "\\0";
}
return s;
});