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

Unified Diff: lib/runtime/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
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:
Download patch
« no previous file with comments | « no previous file | tool/input_sdk/lib/internal/symbol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_sdk.js
diff --git a/lib/runtime/dart_sdk.js b/lib/runtime/dart_sdk.js
index 9fb6c1066b9bbebbf47ed619d628399d05219627..f813cb85f731f42e36088a0bf4c38a403156fa66 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -7687,8 +7687,12 @@ dart_library.library('dart_sdk', null, /* Imports */[
return _internal.Symbol.is(other) && this[_name] == other[_name];
}
get hashCode() {
+ let hash = this._hashCode;
+ if (hash != null) return hash;
let arbitraryPrime = 664597;
- return 536870911 & arbitraryPrime * dart.notNull(dart.hashCode(this[_name]));
+ hash = 536870911 & arbitraryPrime * dart.notNull(dart.hashCode(this[_name]));
+ this._hashCode = hash;
+ return hash;
}
toString() {
return dart.str`Symbol("${this[_name]}")`;
« no previous file with comments | « no previous file | tool/input_sdk/lib/internal/symbol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698