Index: compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
diff --git a/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java b/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
index 79fadd59d835ddd8afc9b328264b1f175de57f04..47f89893d824afce869c30d860de71fabb36b3ce 100644 |
--- a/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
+++ b/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
@@ -2478,7 +2478,9 @@ public class GenerateJavascriptAST { |
mangledName = null; |
qualifier = (JsExpression) generate(target); |
EnclosingElement enclosingElement = element.getEnclosingElement(); |
- if ((kind == ElementKind.FUNCTION_OBJECT) && (element.getEnclosingElement() != null)) { |
+ if (kind == ElementKind.FUNCTION_OBJECT |
zundel
2011/11/07 19:26:53
nit. I would just move this into a separate FUNCT
|
+ && enclosingElement != null |
+ && enclosingElement.getKind() == ElementKind.CLASS) { |
// Function-object invocations can be made directly, unless they're closures (in which |
// case their enclosing-element will be null). |
method = (MethodElement) element; |