| Index: dart/lib/compiler/implementation/lib/js_helper.dart
|
| diff --git a/dart/lib/compiler/implementation/lib/js_helper.dart b/dart/lib/compiler/implementation/lib/js_helper.dart
|
| index 99145eb1d78817c1f5fc7ce6e6f5c720a14a4776..60bb747009465801145e7e8efc17b89afda5a2c4 100644
|
| --- a/dart/lib/compiler/implementation/lib/js_helper.dart
|
| +++ b/dart/lib/compiler/implementation/lib/js_helper.dart
|
| @@ -353,6 +353,18 @@ class ListIterator<T> implements Iterator<T> {
|
| }
|
|
|
| class Primitives {
|
| + static int hashCodeSeed = 0;
|
| +
|
| + static int objectHashCode(object) {
|
| + int hash = JS('var', r'#.$identityHash', object);
|
| + if (hash === null) {
|
| + // TOOD(ahe): We should probably randomize this somehow.
|
| + hash = ++hashCodeSeed;
|
| + JS('void', r'#.$identityHash = #', object, hash);
|
| + }
|
| + return hash;
|
| + }
|
| +
|
| /**
|
| * This is the low-level method that is used to implement
|
| * [print]. It is possible to override this function from JavaScript
|
|
|