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

Unified Diff: lib/json/json.dart

Issue 10124010: Migrate to interpolation instead of concatenation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « client/tests/client/json/json_tests.dart ('k') | lib/unittest/unittest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/json/json.dart
diff --git a/lib/json/json.dart b/lib/json/json.dart
index 00a24359920464547dee28fccea59dce3791021d..4fbf357f37c97fdac5f48920c4bf9096bc6805f7 100644
--- a/lib/json/json.dart
+++ b/lib/json/json.dart
@@ -143,7 +143,7 @@ class JsonTokenizer {
static final int LBRACE = 123; // '{'.charCodeAt(0)
static final int RBRACE = 125; // '}'.charCodeAt(0)
- JsonTokenizer(String s) : _s = s + ' ', _pos = 0, _len = s.length + 1 {}
+ JsonTokenizer(String s) : _s = '${s} ', _pos = 0, _len = s.length + 1;
/**
* Fetches next token or [:null:] if the stream has been exhausted.
@@ -199,11 +199,11 @@ class JsonTokenizer {
break;
case 'u':
if (_pos + 5 > _len) {
- throw 'Invalid unicode esacape sequence: \\' +
- _s.substring(_pos, _len);
+ throw 'Invalid unicode esacape sequence:'
+ '\\${_s.substring(_pos, _len)}';
}
final codeString = _s.substring(_pos + 1, _pos + 5);
- c = Math.parseInt('0x' + codeString);
+ c = Math.parseInt('0x${codeString}');
if (c >= 128) {
// TODO(jmessery): the VM doesn't support 2-byte strings yet
// see runtime/lib/string.cc:49
@@ -213,7 +213,7 @@ class JsonTokenizer {
_pos += 4;
break;
default:
- throw 'Invalid esacape sequence: \\' + _s[_pos];
+ throw 'Invalid esacape sequence: \\${_s[_pos]}';
}
}
charCodes.add(c);
« no previous file with comments | « client/tests/client/json/json_tests.dart ('k') | lib/unittest/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698