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

Unified Diff: tool/input_sdk/patch/internal_patch.dart

Issue 2040963005: Update Symbol.hashCode (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 6 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 | « tool/input_sdk/lib/internal/symbol.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/patch/internal_patch.dart
diff --git a/tool/input_sdk/patch/internal_patch.dart b/tool/input_sdk/patch/internal_patch.dart
index 3684b5b3bdc0233fe39bb27958bcaa1a06efbe14..e4fd296c2c66dba6f771385167e5e068fae72397 100644
--- a/tool/input_sdk/patch/internal_patch.dart
+++ b/tool/input_sdk/patch/internal_patch.dart
@@ -5,12 +5,23 @@
import 'dart:_js_primitives' show printString;
import 'dart:_js_helper' show patch;
import 'dart:_interceptors' show JSArray;
+import 'dart:_foreign_helper' show JS;
@patch
class Symbol implements core.Symbol {
@patch
const Symbol(String name)
: this._name = name;
+
+ @patch
+ int get hashCode {
+ int hash = JS('int|Null', '#._hashCode', this);
+ if (hash != null) return hash;
+ const arbitraryPrime = 664597;
+ hash = 0x1fffffff & (arbitraryPrime * _name.hashCode);
+ JS('', '#._hashCode = #', this, hash);
+ return hash;
+ }
}
@patch
« no previous file with comments | « tool/input_sdk/lib/internal/symbol.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698