Chromium Code Reviews| Index: pkg/dev_compiler/tool/input_sdk/private/js_helper.dart |
| diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart |
| index a20547be96933a84537807eec275f4455c90661b..8b53cc602b879f520335707ff13d292ab19027c4 100644 |
| --- a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart |
| +++ b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart |
| @@ -25,6 +25,8 @@ part 'regexp_helper.dart'; |
| part 'string_helper.dart'; |
| part 'js_rti.dart'; |
| +final _identityHashCode = JS('', 'Symbol("_identityHashCode")'); |
| + |
| class _Patch { |
| const _Patch(); |
| } |
| @@ -57,10 +59,10 @@ class Primitives { |
| } |
| static int objectHashCode(object) { |
| - int hash = JS('int|Null', r'#.$identityHash', object); |
|
Jacob
2017/02/20 22:48:54
this making the test unstable as it was hard to ke
|
| + int hash = JS('int|Null', r'#[#]', object, _identityHashCode); |
| if (hash == null) { |
| hash = JS('int', '(Math.random() * 0x3fffffff) | 0'); |
| - JS('void', r'#.$identityHash = #', object, hash); |
| + JS('void', r'#[#] = #', object, _identityHashCode, hash); |
| } |
| return JS('int', '#', hash); |
| } |