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

Unified Diff: lib/core/object.dart

Issue 10908287: Make identical(a,b) a compile-time constant in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: lib/core/object.dart
diff --git a/lib/core/object.dart b/lib/core/object.dart
index 7febc393e5de13dd3b615ca8f80375a392ec25a6..2506d1777e086474cb7fce3b1877830dc15b525a 100644
--- a/lib/core/object.dart
+++ b/lib/core/object.dart
@@ -8,7 +8,7 @@
class Object {
const Object();
- bool operator ==(other) => this === other;
+ bool operator ==(other) => identical(this, other);
get dynamic => this;
@@ -16,3 +16,8 @@ class Object {
external void noSuchMethod(String name, List args);
}
+
+/**
+ * Check whether two references are to the same object.
+ */
+bool identical(Object a, Object b) => a === b;

Powered by Google App Engine
This is Rietveld 408576698