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

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

Issue 10910142: Issue 4988. Fixe for 'assert' statement vs function resolving (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for artificial 'assert' function name 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/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index c5c0a4a33fb177e0a1fbaf96c70f4744cf2a32ba..d11f50f53a34523c3cddf576209641d3db5d0a60 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1467,6 +1467,10 @@ public class Resolver {
public Element visitUnqualifiedInvocation(DartUnqualifiedInvocation x) {
Scope scope = getContext().getScope();
Element element = scope.findElement(scope.getLibrary(), x.getTarget().getName());
+ if (element == null && x.getTarget().getName().equals("assert")
+ && x.getArguments().size() == 1) {
+ element = scope.findElement(scope.getLibrary(), Elements.ASSERT_FUNCTION_NAME);
+ }
ElementKind kind = ElementKind.of(element);
if (!INVOKABLE_ELEMENTS.contains(kind)) {
diagnoseErrorInUnqualifiedInvocation(x);

Powered by Google App Engine
This is Rietveld 408576698