Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: src/json-stringifier.h

Issue 12207153: Drop latin-1 check from BasicJsonStringifier::DoNotEscape (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixes Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index cec98443a5c628cb103c56e27aec2db4e35a4fb6..55f435018cb06193c96732c8308e0aa62f6de09d 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -206,8 +206,39 @@ const char* const BasicJsonStringifier::JsonEscapeTable =
"p\0 q\0 r\0 s\0 "
"t\0 u\0 v\0 w\0 "
"x\0 y\0 z\0 {\0 "
- "|\0 }\0 ~\0 \177\0 ";
-
+ "|\0 }\0 ~\0 \177\0 "
+ "\200\0 \201\0 \202\0 \203\0 "
+ "\204\0 \205\0 \206\0 \207\0 "
+ "\210\0 \211\0 \212\0 \213\0 "
+ "\214\0 \215\0 \216\0 \217\0 "
+ "\220\0 \221\0 \222\0 \223\0 "
+ "\224\0 \225\0 \226\0 \227\0 "
+ "\230\0 \231\0 \232\0 \233\0 "
+ "\234\0 \235\0 \236\0 \237\0 "
+ "\240\0 \241\0 \242\0 \243\0 "
+ "\244\0 \245\0 \246\0 \247\0 "
+ "\250\0 \251\0 \252\0 \253\0 "
+ "\254\0 \255\0 \256\0 \257\0 "
+ "\260\0 \261\0 \262\0 \263\0 "
+ "\264\0 \265\0 \266\0 \267\0 "
+ "\270\0 \271\0 \272\0 \273\0 "
+ "\274\0 \275\0 \276\0 \277\0 "
+ "\300\0 \301\0 \302\0 \303\0 "
+ "\304\0 \305\0 \306\0 \307\0 "
+ "\310\0 \311\0 \312\0 \313\0 "
+ "\314\0 \315\0 \316\0 \317\0 "
+ "\320\0 \321\0 \322\0 \323\0 "
+ "\324\0 \325\0 \326\0 \327\0 "
+ "\330\0 \331\0 \332\0 \333\0 "
+ "\334\0 \335\0 \336\0 \337\0 "
+ "\340\0 \341\0 \342\0 \343\0 "
+ "\344\0 \345\0 \346\0 \347\0 "
+ "\350\0 \351\0 \352\0 \353\0 "
+ "\354\0 \355\0 \356\0 \357\0 "
+ "\360\0 \361\0 \362\0 \363\0 "
+ "\364\0 \365\0 \366\0 \367\0 "
+ "\370\0 \371\0 \372\0 \373\0 "
+ "\374\0 \375\0 \376\0 \377\0 ";
BasicJsonStringifier::BasicJsonStringifier(Isolate* isolate)
: isolate_(isolate), current_index_(0), is_ascii_(true) {
@@ -698,9 +729,15 @@ void BasicJsonStringifier::SerializeString_(Handle<String> string) {
}
-template <typename Char>
-bool BasicJsonStringifier::DoNotEscape(Char c) {
- return (c >= 0x80) || (c >= '#' && c <= '~' && c != '\\');
+template <>
+bool BasicJsonStringifier::DoNotEscape(uint8_t c) {
+ return c >= '#' && c <= '~' && c != '\\';
+}
+
+
+template <>
+bool BasicJsonStringifier::DoNotEscape(uint16_t c) {
+ return c >= '#' && c != '\\' && c != 0x7f;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698