TSII-1535: Also do not un-escape \uffff
This commit is contained in:
parent
0111497fc9
commit
3ff660392e
|
|
@ -134,7 +134,7 @@ function OutputStream(options) {
|
||||||
|
|
||||||
function make_string(str, quote) {
|
function make_string(str, quote) {
|
||||||
var dq = 0, sq = 0;
|
var dq = 0, sq = 0;
|
||||||
str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,
|
str = str.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff\uffff]/g,
|
||||||
function(s, i){
|
function(s, i){
|
||||||
switch (s) {
|
switch (s) {
|
||||||
case '"': ++dq; return '"';
|
case '"': ++dq; return '"';
|
||||||
|
|
@ -149,6 +149,7 @@ function OutputStream(options) {
|
||||||
case "\u2028": return "\\u2028";
|
case "\u2028": return "\\u2028";
|
||||||
case "\u2029": return "\\u2029";
|
case "\u2029": return "\\u2029";
|
||||||
case "\ufeff": return "\\ufeff";
|
case "\ufeff": return "\\ufeff";
|
||||||
|
case "\uffff": return "\\uffff";
|
||||||
case "\0":
|
case "\0":
|
||||||
return /[0-7]/.test(str.charAt(i+1)) ? "\\x00" : "\\0";
|
return /[0-7]/.test(str.charAt(i+1)) ? "\\x00" : "\\0";
|
||||||
}
|
}
|
||||||
|
|
@ -1282,6 +1283,7 @@ function OutputStream(options) {
|
||||||
0x0d , // \r
|
0x0d , // \r
|
||||||
0x00 , // \0
|
0x00 , // \0
|
||||||
0xfeff , // Unicode BOM
|
0xfeff , // Unicode BOM
|
||||||
|
0xffff , // Unicode noncharacter
|
||||||
0x2028 , // unicode "line separator"
|
0x2028 , // unicode "line separator"
|
||||||
0x2029 , // unicode "paragraph separator"
|
0x2029 , // unicode "paragraph separator"
|
||||||
].indexOf(code) < 0;
|
].indexOf(code) < 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user