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

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

Issue 11412121: Fix dart2js hashCode implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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: sdk/lib/_internal/compiler/implementation/lib/js_string.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
index 9c438ac47757261fcdbe3d0244099834ae49b2e6..af2756cb436714bd6651318ccbdd7db73ed1fcf9 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
@@ -145,12 +145,12 @@ class JSString implements String {
int hash = 0;
for (int i = 0; i < length; i++) {
hash = 0x1fffffff & (hash + JS('int', r'#.charCodeAt(#)', this, i));
- hash = 0x1fffffff & (hash + (0x0007ffff & hash) << 10);
+ hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
hash = JS('int', '# ^ (# >> 6)', hash, hash);
}
- hash = 0x1fffffff & (hash + (0x03ffffff & hash) << 3);
+ hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
hash = JS('int', '# ^ (# >> 11)', hash, hash);
- return 0x1fffffff & (hash + (0x00003fff & hash) << 15);
+ return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
Type get runtimeType => createRuntimeType('String');

Powered by Google App Engine
This is Rietveld 408576698