aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Lautanala <lautis@gmail.com>2013-06-03 20:18:42 +0300
committerVille Lautanala <lautis@gmail.com>2013-06-03 20:46:42 +0300
commitf29f07aabd9d9f67ef7b826abb949262033d9273 (patch)
tree6ebb73f79344cf2733ee210aa5757b9ff70dbbf6
parent188e28efd7fa45711be5ced62b04da13511feb8b (diff)
downloadtracifyjs-f29f07aabd9d9f67ef7b826abb949262033d9273.tar.gz
tracifyjs-f29f07aabd9d9f67ef7b826abb949262033d9273.zip
Escape null characters as \x00
Since \0 might be mistakenly interpreted as octal if followed by a number and using literal null is in some cases interpreted as end of string, escape null as \x00.
-rw-r--r--lib/output.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/output.js b/lib/output.js
index 60a4a26c..dc78a5da 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -96,7 +96,7 @@ function OutputStream(options) {
case "\u2029": return "\\u2029";
case '"': ++dq; return '"';
case "'": ++sq; return "'";
- case "\0": return "\\0";
+ case "\0": return "\\x00";
}
return s;
});