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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/Elements.java

Issue 10942020: Issue 5215. Invocation identical(x,y) is compile-time constant (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: compiler/java/com/google/dart/compiler/resolver/Elements.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Elements.java b/compiler/java/com/google/dart/compiler/resolver/Elements.java
index 6ced5c8e63b2d25020b7b86cce47dd94f132be10..f61f0703824dd0ad72063a1d5c0bcac54f50333d 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Elements.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Elements.java
@@ -736,6 +736,20 @@ static FieldElementImplementation fieldFromNode(DartField node,
}
/**
+ * @return <code>true</code> if given {@link Element} if {@link MethodElement} for
+ * function "identical".
+ */
+ public static boolean isFunctionIdentical(Element element) {
+ if (element instanceof MethodElement) {
+ MethodElement methodElement = (MethodElement) element;
+ return Objects.equal(methodElement.getName(), "identical")
+ && methodElement.getEnclosingElement() instanceof LibraryElement
+ && methodElement.getEnclosingElement().getName().equals("dart://core/core.dart");
+ }
+ return false;
+ }
+
+ /**
* @return <code>true</code> if given {@link Element} if {@link MethodElement} for artificial
* "assert" statement.
*/

Powered by Google App Engine
This is Rietveld 408576698