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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java

Issue 14322008: Version 0.4.7.3 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 8 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java (revision 21601)
+++ editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/verifier/ErrorVerifier.java (working copy)
@@ -152,7 +152,7 @@
* The method or function that we are currently visiting, or {@code null} if we are not inside a
* method or function.
*/
- private ExecutableElement currentFunction;
+ private ExecutableElement enclosingFunction;
/**
* This map is initialized when visiting the contents of a class declaration. If the visitor is
@@ -260,9 +260,9 @@
@Override
public Void visitConstructorDeclaration(ConstructorDeclaration node) {
- ExecutableElement previousFunction = currentFunction;
+ ExecutableElement outerFunction = enclosingFunction;
try {
- currentFunction = node.getElement();
+ enclosingFunction = node.getElement();
isEnclosingConstructorConst = node.getConstKeyword() != null;
checkForConstConstructorWithNonFinalField(node);
checkForConflictingConstructorNameAndMember(node);
@@ -270,7 +270,7 @@
return super.visitConstructorDeclaration(node);
} finally {
isEnclosingConstructorConst = false;
- currentFunction = previousFunction;
+ enclosingFunction = outerFunction;
}
}
@@ -295,23 +295,23 @@
@Override
public Void visitFunctionDeclaration(FunctionDeclaration node) {
- ExecutableElement previousFunction = currentFunction;
+ ExecutableElement outerFunction = enclosingFunction;
try {
- currentFunction = node.getElement();
+ enclosingFunction = node.getElement();
return super.visitFunctionDeclaration(node);
} finally {
- currentFunction = previousFunction;
+ enclosingFunction = outerFunction;
}
}
@Override
public Void visitFunctionExpression(FunctionExpression node) {
- ExecutableElement previousFunction = currentFunction;
+ ExecutableElement outerFunction = enclosingFunction;
try {
- currentFunction = node.getElement();
+ enclosingFunction = node.getElement();
return super.visitFunctionExpression(node);
} finally {
- currentFunction = previousFunction;
+ enclosingFunction = outerFunction;
}
}
@@ -355,12 +355,12 @@
@Override
public Void visitMethodDeclaration(MethodDeclaration node) {
- ExecutableElement previousFunction = currentFunction;
+ ExecutableElement previousFunction = enclosingFunction;
try {
- currentFunction = node.getElement();
+ enclosingFunction = node.getElement();
return super.visitMethodDeclaration(node);
} finally {
- currentFunction = previousFunction;
+ enclosingFunction = previousFunction;
}
}
@@ -1078,7 +1078,7 @@
* @see StaticTypeWarningCode#RETURN_OF_INVALID_TYPE
*/
private boolean checkForReturnOfInvalidType(ReturnStatement node) {
- FunctionType functionType = currentFunction == null ? null : currentFunction.getType();
+ FunctionType functionType = enclosingFunction == null ? null : enclosingFunction.getType();
Type expectedReturnType = functionType == null ? null : functionType.getReturnType();
Expression returnExpression = node.getExpression();
if (expectedReturnType != null && !expectedReturnType.isVoid() && returnExpression != null) {
@@ -1089,7 +1089,7 @@
returnExpression,
actualReturnType.getName(),
expectedReturnType.getName(),
- currentFunction.getName());
+ enclosingFunction.getName());
return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698