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

Unified Diff: dart/frog/leg/scanner/byte_strings.dart

Issue 9447100: Return null from stringValue and call slowToString() instead of toString(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: changes Created 8 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 | « dart/frog/leg/resolver.dart ('k') | dart/frog/leg/scanner/keyword.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/scanner/byte_strings.dart
diff --git a/dart/frog/leg/scanner/byte_strings.dart b/dart/frog/leg/scanner/byte_strings.dart
index 17777fcafd5fa9e4e4cf79f0407b159d5f670fe0..e6daab14eda03bc13210f2d1de1598bbc50ac29c 100644
--- a/dart/frog/leg/scanner/byte_strings.dart
+++ b/dart/frog/leg/scanner/byte_strings.dart
@@ -15,9 +15,11 @@ class ByteString implements SourceString {
abstract String get charset();
- String toString() => new String.fromCharCodes(
+ String slowToString() => new String.fromCharCodes(
new Utf8Decoder(bytes, offset, length).decodeRest());
+ String toString() => "ByteString(${slowToString()})";
+
bool operator ==(other) {
throw "should be overridden in subclass";
}
@@ -41,7 +43,7 @@ class ByteString implements SourceString {
}
printOn(StringBuffer sb) {
- sb.add(toString());
+ sb.add(slowToString());
}
bool isEmpty() => length == 0;
« no previous file with comments | « dart/frog/leg/resolver.dart ('k') | dart/frog/leg/scanner/keyword.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698