OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 @patch class Object { | 5 @patch class Object { |
6 | 6 |
7 // The VM has its own implementation of equals. | 7 // The VM has its own implementation of equals. |
8 @patch bool operator ==(other) native "Object_equals"; | 8 bool operator ==(other) native "Object_equals"; |
9 | 9 |
10 // Helpers used to implement hashCode. If a hashCode is used, we remember it | 10 // Helpers used to implement hashCode. If a hashCode is used, we remember it |
11 // in a weak table in the VM. A new hashCode value is calculated using a | 11 // in a weak table in the VM. A new hashCode value is calculated using a |
12 // number generator. | 12 // number generator. |
13 static final _hashCodeRnd = new Random(); | 13 static final _hashCodeRnd = new Random(); |
14 | 14 |
15 static _getHash(obj) native "Object_getHash"; | 15 static _getHash(obj) native "Object_getHash"; |
16 static _setHash(obj, hash) native "Object_setHash"; | 16 static _setHash(obj, hash) native "Object_setHash"; |
17 | 17 |
18 // Shared static implentation for hashCode and _identityHashCode. | 18 // Shared static implentation for hashCode and _identityHashCode. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 _as(instantiator_type_arguments, type) native "Object_as"; | 74 _as(instantiator_type_arguments, type) native "Object_as"; |
75 | 75 |
76 static _symbolMapToStringMap(Map<Symbol, dynamic> map) { | 76 static _symbolMapToStringMap(Map<Symbol, dynamic> map) { |
77 var result = new Map<String, dynamic>(); | 77 var result = new Map<String, dynamic>(); |
78 map.forEach((Symbol key, value) { | 78 map.forEach((Symbol key, value) { |
79 result[internal.Symbol.getName(key)] = value; | 79 result[internal.Symbol.getName(key)] = value; |
80 }); | 80 }); |
81 return result; | 81 return result; |
82 } | 82 } |
83 } | 83 } |
OLD | NEW |