Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #include "vm/bootstrap_natives.h" | |
| 6 | |
| 7 namespace dart { | |
| 8 | |
| 9 DEFINE_NATIVE_ENTRY(Identical_comparison, 2) { | |
| 10 GET_NON_NULL_NATIVE_ARGUMENT( | |
| 11 Instance, a, arguments->NativeArgAt(0)); | |
| 12 GET_NON_NULL_NATIVE_ARGUMENT( | |
| 13 Instance, b, arguments->NativeArgAt(1)); | |
| 14 // If the objects are both smi's, compare their values. | |
| 15 if (a.IsSmi() && b.IsSmi()) { | |
| 16 return Bool::Get(a.Equals(b)); | |
|
srdjan
2012/12/17 19:42:47
YOu need to do the same for Doubles, Mints and Big
Max Heinritz (Google)
2012/12/17 21:15:23
Done.
| |
| 17 } | |
| 18 // If the objects are not smi's, then compare their references. | |
| 19 return Bool::Get(a.raw() == b.raw()); | |
| 20 } | |
| 21 | |
| 22 | |
| 23 } // namespace dart | |
| OLD | NEW |