Fix handling of escaped characters in string

This commit is contained in:
Sébastien Arod
2015-10-29 14:55:23 +01:00
parent b60d88fa80
commit f5e73ab8bf
2 changed files with 19 additions and 2 deletions

View File

@@ -430,8 +430,9 @@ namespace ts {
let nextChar = (i + 1 < jsonText.length) ? jsonText.charAt(i + 1) : undefined;
if (processingString) {
if (currentChar === "\\"
&& nextChar === "\"") {
// Escaped quote consume the 2 characters
&& nextChar !== undefined) {
// Found an escaped character
// consume the \ and the escaped char
result += currentChar;
result += nextChar;
i += 1;