Revert r16112 from trunk.
Review URL: https://codereview.chromium.org//11576032
git-svn-id: http://dart.googlecode.com/svn/trunk@16164 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/runtime/lib/identical_patch.dart b/runtime/lib/identical_patch.dart
index 3ea32de..218b3c8 100644
--- a/runtime/lib/identical_patch.dart
+++ b/runtime/lib/identical_patch.dart
@@ -2,4 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-patch bool identical(Object a, Object b) => a === b;
+patch bool identical(Object a, Object b) {
+ throw new Error('Should not reach the body of identical');
+}
diff --git a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
index e7054ce..b375a97 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -213,6 +213,6 @@
}
// Patch for 'identical' function.
-// This is very magical: the compiler knows how to optimize a call to
-// identical, so we can just express identical in terms of itself.
-patch bool identical(Object a, Object b) => identical(a, b);
+patch bool identical(Object a, Object b) {
+ throw new Error('Should not reach the body of identical');
+}
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index d3dfdbc..ebbec8c 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3413,7 +3413,7 @@
return;
}
- if (element.declaration == compiler.identicalFunction) {
+ if (identical(element, compiler.identicalFunction)) {
pushWithPosition(new HIdentity(target, inputs[1], inputs[2]), node);
return;
}
diff --git a/tests/language/identical_closure_test.dart b/tests/language/identical_closure_test.dart
deleted file mode 100644
index d4d9088..0000000
--- a/tests/language/identical_closure_test.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-var myIdentical = identical;
-
-main() {
- Expect.isTrue(myIdentical(42, 42));
-}
diff --git a/tools/VERSION b/tools/VERSION
index 690c093..18a30b6 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
MAJOR 0
MINOR 2
BUILD 9
-PATCH 4
+PATCH 5