diff options
Diffstat (limited to 'third_party/WebKit/Source/platform/JSONValues.cpp')
-rw-r--r-- | third_party/WebKit/Source/platform/JSONValues.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/third_party/WebKit/Source/platform/JSONValues.cpp b/third_party/WebKit/Source/platform/JSONValues.cpp index 76ec444..3001d16 100644 --- a/third_party/WebKit/Source/platform/JSONValues.cpp +++ b/third_party/WebKit/Source/platform/JSONValues.cpp @@ -66,9 +66,8 @@ void writeIndent(int depth, StringBuilder* output) } // anonymous namespace -void doubleQuoteStringForJSON(const String& str, StringBuilder* dst) +void escapeStringForJSON(const String& str, StringBuilder* dst) { - dst->append('"'); for (unsigned i = 0; i < str.length(); ++i) { UChar c = str[i]; if (!escapeChar(c, dst)) { @@ -84,6 +83,12 @@ void doubleQuoteStringForJSON(const String& str, StringBuilder* dst) } } } +} + +void doubleQuoteStringForJSON(const String& str, StringBuilder* dst) +{ + dst->append('"'); + escapeStringForJSON(str, dst); dst->append('"'); } |