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

Unified Diff: pkg/analyzer_experimental/lib/src/string_source.dart

Issue 23566017: Fix StringSource. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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: pkg/analyzer_experimental/lib/src/string_source.dart
diff --git a/pkg/analyzer_experimental/lib/src/string_source.dart b/pkg/analyzer_experimental/lib/src/string_source.dart
index b4733658227ae4850a18cc56cacc39f03b64959d..ab218095a4a0d99ec423b099cbd0bc2e4afdf71d 100644
--- a/pkg/analyzer_experimental/lib/src/string_source.dart
+++ b/pkg/analyzer_experimental/lib/src/string_source.dart
@@ -15,26 +15,31 @@ class StringSource implements Source {
StringSource(this._contents, this.fullName)
: modificationStamp = new DateTime.now().millisecondsSinceEpoch;
- bool operator==(Object object) => object is StringSource &&
- object._contents == _contents && object._name == _name;
+ bool operator==(Object object) {
+ if (object is StringSource) {
+ StringSource ssObject = object;
+ return ssObject._contents == _contents && ssObject.fullName == fullName;
+ }
+ return false;
+ }
bool exists() => true;
void getContents(Source_ContentReceiver receiver) =>
receiver.accept2(_contents, modificationStamp);
- String get encoding => throw UnsupportedError("StringSource doesn't support "
+ String get encoding => throw new UnsupportedError("StringSource doesn't support "
"encoding.");
String get shortName => fullName;
- String get uriKind => throw UnsupportedError("StringSource doesn't support "
+ UriKind get uriKind => throw new UnsupportedError("StringSource doesn't support "
"uriKind.");
- int get hashCode => _contents.hashCode ^ _name.hashCode;
+ int get hashCode => _contents.hashCode ^ fullName.hashCode;
bool get isInSystemLibrary => false;
- Source resolveRelative(Uri relativeUri) => throw UnsupportedError(
+ Source resolveRelative(Uri relativeUri) => throw new UnsupportedError(
"StringSource doesn't support resolveRelative.");
}
« 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