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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart

Issue 14646031: Implement invoke, setField, and getField (unminified). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments. Created 7 years, 7 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
Index: dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
index fd64f48144278759c59dc44513f79f1dc68821af..c6d5727c0044537c9e3251f3c7965cc8fb5db787 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/lib/js_rti.dart
@@ -21,13 +21,17 @@ getRuntimeTypeArgument(target, substitution, index) {
}
class TypeImpl implements Type {
- final String typeName;
- TypeImpl(this.typeName);
- toString() => typeName;
- int get hashCode => typeName.hashCode;
+ final String _typeName;
+
+ TypeImpl(this._typeName);
+
+ toString() => _typeName;
+
+ // TODO(ahe): This is a poor hashCode as it collides with its name.
+ int get hashCode => _typeName.hashCode;
+
bool operator ==(other) {
- if (other is !TypeImpl) return false;
- return typeName == other.typeName;
+ return (other is TypeImpl) && _typeName == other._typeName;
}
}

Powered by Google App Engine
This is Rietveld 408576698