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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/js_helper.dart

Issue 2703263002: Custom formatter cleanup Fix case where displaying a class constructor generated unreadable huge ou… (Closed)
Patch Set: Custom formatter cleanup Fix case where displaying a class constructor generated unreadable huge ou… Created 3 years, 10 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 | « pkg/dev_compiler/tool/input_sdk/private/debugger.dart ('k') | tests/lib_strong/html/debugger_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ 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);
}
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/debugger.dart ('k') | tests/lib_strong/html/debugger_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698