Index: lib/compiler/implementation/lib/interceptors.dart |
diff --git a/lib/compiler/implementation/lib/interceptors.dart b/lib/compiler/implementation/lib/interceptors.dart |
index 1cb7fc62d7a92317aafed8afc5a771b8d18adfaf..0b4d115049d58f2a13d4237545ce1bc319f8c04e 100644 |
--- a/lib/compiler/implementation/lib/interceptors.dart |
+++ b/lib/compiler/implementation/lib/interceptors.dart |
@@ -617,6 +617,7 @@ trim(receiver) { |
hashCode(receiver) { |
// TODO(ahe): This method shouldn't have to use JS. Update when our |
// optimizations are smarter. |
+ if (receiver === null) return 0; |
if (receiver is num) return JS('int', r'# & 0x1FFFFFFF', receiver); |
if (receiver is !String) return UNINTERCEPTED(receiver.hashCode()); |
int hash = 0; |
@@ -651,8 +652,6 @@ isOdd(receiver) { |
return (receiver & 1) === 1; |
} |
-get$toString(receiver) => () => toString(receiver); |
- |
get$runtimeType(receiver) { |
if (receiver is int) { |
return getOrCreateCachedRuntimeType('int'); |
@@ -660,9 +659,17 @@ get$runtimeType(receiver) { |
return getOrCreateCachedRuntimeType('String'); |
} else if (receiver is double) { |
return getOrCreateCachedRuntimeType('double'); |
+ } else if (receiver === null) { |
+ return getOrCreateCachedRuntimeType('Null'); |
} else if (isJsArray(receiver)) { |
return getOrCreateCachedRuntimeType('List'); |
} else { |
return UNINTERCEPTED(receiver.runtimeType); |
} |
} |
+ |
+// TODO(lrn): These getters should be generated added automatically for all |
+// methods. |
+get$toString(receiver) => () => toString(receiver); |
+ |
+get$hashCode(receiver) => () => hashCode(receiver); |