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

Unified Diff: dart/frog/leg/scanner/string_scanner.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/scanner/scanner_task.dart ('k') | dart/frog/leg/scanner/token.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/scanner/string_scanner.dart
diff --git a/dart/frog/leg/scanner/string_scanner.dart b/dart/frog/leg/scanner/string_scanner.dart
index 1f581c4b571aa77afc0d02a33d4d8bb8721b2443..3a973a4c2aaae61324d7b6a7d9386b63db7bf99b 100644
--- a/dart/frog/leg/scanner/string_scanner.dart
+++ b/dart/frog/leg/scanner/string_scanner.dart
@@ -41,19 +41,21 @@ class SubstringWrapper implements SourceString {
const SubstringWrapper(String this.internalString,
int this.begin, int this.end);
- int hashCode() => toString().hashCode();
+ int hashCode() => slowToString().hashCode();
bool operator ==(other) {
- return other is SourceString && toString() == other.toString();
+ return other is SourceString && slowToString() == other.slowToString();
}
void printOn(StringBuffer sb) {
- sb.add(this);
+ sb.add(internalString.substring(begin, end));
}
- String toString() => internalString.substring(begin, end);
+ String slowToString() => internalString.substring(begin, end);
- String get stringValue() => toString();
+ String toString() => "SubstringWrapper(slowToString())";
+
+ String get stringValue() => null;
Iterator<int> iterator() =>
new StringCodeIterator.substring(internalString, begin, end);
« no previous file with comments | « dart/frog/leg/scanner/scanner_task.dart ('k') | dart/frog/leg/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698