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

Unified Diff: runtime/lib/identical.cc

Issue 24254004: Make Dart_IdentityEqual live up to its sepc and not leak boxing implementation detail. (Reland r275… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debug prints Created 7 years, 3 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 | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/identical.cc
diff --git a/runtime/lib/identical.cc b/runtime/lib/identical.cc
index 7508f03ac85b89431dcdab9ae78ea8384becb4b5..dac63b53f0cebba763c3136462145409b7a22899 100644
--- a/runtime/lib/identical.cc
+++ b/runtime/lib/identical.cc
@@ -11,21 +11,7 @@ namespace dart {
DEFINE_NATIVE_ENTRY(Identical_comparison, 2) {
GET_NATIVE_ARGUMENT(Instance, a, arguments->NativeArgAt(0));
GET_NATIVE_ARGUMENT(Instance, b, arguments->NativeArgAt(1));
- if (a.raw() == b.raw()) return Bool::True().raw();
- if (a.IsInteger() && b.IsInteger()) {
- return Bool::Get(a.Equals(b)).raw();
- }
- if (a.IsDouble() && b.IsDouble()) {
- if (a.Equals(b)) return Bool::True().raw();
- // Check for NaN.
- const Double& a_double = Double::Cast(a);
- const Double& b_double = Double::Cast(b);
- if (isnan(a_double.value()) && isnan(b_double.value())) {
- return Bool::True().raw();
- }
- }
- return Bool::False().raw();
+ return Bool::Get(a.IsIdenticalTo(b)).raw();
}
-
} // namespace dart
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698