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

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

Issue 10696006: Issue 3793. Fix for function expressions with a parameter of the same name (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 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 349f7b7b4437e684d32c9aa7f2ef914314e02b6a..84d698d5b952ccdddac0e5dea93beb4f36e45158 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -781,9 +781,19 @@ public class Resolver {
}
MethodElement previousFunction = innermostFunction;
innermostFunction = element;
- DartFunction functionNode = x.getFunction();
- resolveFunction(functionNode, element);
- resolve(functionNode.getBody());
+ {
+ DartFunction functionNode = x.getFunction();
+ EnclosingElement previousEnclosingElement = enclosingElement;
+ enclosingElement = element;
+ getContext().pushFunctionScope(x);
+ try {
+ resolveFunction(functionNode, element);
+ resolve(functionNode.getBody());
+ } finally {
+ getContext().popScope();
+ enclosingElement = previousEnclosingElement;
+ }
+ }
innermostFunction = previousFunction;
getContext().popScope();
if (x.getName() != null) {

Powered by Google App Engine
This is Rietveld 408576698