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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

Issue 2754583002: Fix equality invocation on native objects (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | tests/lib_strong/html/client_rect_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/ddc_runtime/operations.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index f7fa49105fab10aad80afb94d475187a898db39b..aeae578522840f35ce0c2e26a118495ab2ac76dd 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -622,11 +622,13 @@ addTypeTests(ctor) => JS(
};
})()''');
+// TODO(vsm): Consider optimizing this. We may be able to statically
+// determine which == operation to invoke given the static types.
equals(x, y) => JS(
'',
'''(() => {
if ($x == null || $y == null) return $x == $y;
- let eq = $x['=='];
+ let eq = $x[dartx['==']] || $x['=='];
return eq ? eq.call($x, $y) : $x === $y;
})()''');
« no previous file with comments | « no previous file | tests/lib_strong/html/client_rect_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698