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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/Resolver.java

Issue 10516006: Issue 3268. Support for replacing 'assert' statement with 'assert' function (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes for review comments Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 package com.google.dart.compiler.resolver; 5 package com.google.dart.compiler.resolver;
6 6
7 import com.google.common.annotations.VisibleForTesting; 7 import com.google.common.annotations.VisibleForTesting;
8 import com.google.common.collect.Lists; 8 import com.google.common.collect.Lists;
9 import com.google.common.collect.Sets; 9 import com.google.common.collect.Sets;
10 import com.google.dart.compiler.DartCompilationPhase; 10 import com.google.dart.compiler.DartCompilationPhase;
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 @Override 1214 @Override
1215 public Element visitUnqualifiedInvocation(DartUnqualifiedInvocation x) { 1215 public Element visitUnqualifiedInvocation(DartUnqualifiedInvocation x) {
1216 Scope scope = getContext().getScope(); 1216 Scope scope = getContext().getScope();
1217 Element element = scope.findElement(scope.getLibrary(), x.getTarget().getN ame()); 1217 Element element = scope.findElement(scope.getLibrary(), x.getTarget().getN ame());
1218 ElementKind kind = ElementKind.of(element); 1218 ElementKind kind = ElementKind.of(element);
1219 if (!INVOKABLE_ELEMENTS.contains(kind)) { 1219 if (!INVOKABLE_ELEMENTS.contains(kind)) {
1220 diagnoseErrorInUnqualifiedInvocation(x); 1220 diagnoseErrorInUnqualifiedInvocation(x);
1221 } else { 1221 } else {
1222 checkInvocationTarget(x, currentMethod, element); 1222 checkInvocationTarget(x, currentMethod, element);
1223 } 1223 }
1224 recordElement(x, element);
1224 recordElement(x.getTarget(), element); 1225 recordElement(x.getTarget(), element);
1225 visit(x.getArguments()); 1226 visit(x.getArguments());
1226 return null; 1227 return null;
1227 } 1228 }
1228 1229
1229 @Override 1230 @Override
1230 public Element visitFunctionObjectInvocation(DartFunctionObjectInvocation x) { 1231 public Element visitFunctionObjectInvocation(DartFunctionObjectInvocation x) {
1231 x.getTarget().accept(this); 1232 x.getTarget().accept(this);
1232 visit(x.getArguments()); 1233 visit(x.getArguments());
1233 return null; 1234 return null;
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 ClassElement nextClass = (ClassElement) nextConstructorElement.getEnclos ingElement(); 1902 ClassElement nextClass = (ClassElement) nextConstructorElement.getEnclos ingElement();
1902 ClassElement currentClass = (ClassElement) constructor.getEnclosingEleme nt(); 1903 ClassElement currentClass = (ClassElement) constructor.getEnclosingEleme nt();
1903 if (nextClass == currentClass) { 1904 if (nextClass == currentClass) {
1904 return (ConstructorNodeElement) nextConstructorElement; 1905 return (ConstructorNodeElement) nextConstructorElement;
1905 } 1906 }
1906 } 1907 }
1907 } 1908 }
1908 return null; 1909 return null;
1909 } 1910 }
1910 } 1911 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698