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

Unified Diff: runtime/lib/convert_patch.dart

Issue 677423002: Fix assertion not holding (calling with start==end) and typo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | tests/lib/convert/json_utf8_chunk_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/convert_patch.dart
diff --git a/runtime/lib/convert_patch.dart b/runtime/lib/convert_patch.dart
index d1bda45d904462fef23ab11dec77941d344c5d22..eea0fa5f2a4b32d59c354c676d67bfa099371250 100644
--- a/runtime/lib/convert_patch.dart
+++ b/runtime/lib/convert_patch.dart
@@ -945,7 +945,8 @@ abstract class _ChunkedJsonParser {
}
if (char == BACKSLASH) {
beginString();
- addSliceToString(start, position - 1);
+ int sliceEnd = position - 1;
+ if (start < sliceEnd) addSliceToString(start, sliceEnd);
return parseStringToBuffer(position - 1);
}
if (char == QUOTE) {
@@ -957,7 +958,7 @@ abstract class _ChunkedJsonParser {
}
}
beginString();
- addSliceToString(start, end);
+ if (start < end) addSliceToString(start, end);
return chunkString(STR_PLAIN);
}
@@ -1635,7 +1636,7 @@ class _JsonUtf8Parser extends _ChunkedJsonParser {
String getString(int start, int end) {
beginString();
- addSliceToString(start, end);
+ if (start < end) addSliceToString(start, end);
String result = endString();
return result;
}
« no previous file with comments | « no previous file | tests/lib/convert/json_utf8_chunk_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698