Chromium Code Reviews| Index: lib/compiler/implementation/resolver.dart |
| diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart |
| index 373d01e14180cde4112be7ea551770e63a273bd2..d97d5efec7eb52a2fef553be88b833b4daea0847 100644 |
| --- a/lib/compiler/implementation/resolver.dart |
| +++ b/lib/compiler/implementation/resolver.dart |
| @@ -1372,9 +1372,17 @@ class ResolverVisitor extends CommonResolverVisitor<Element> { |
| } else { |
| name = node.name.asIdentifier().source; |
| } |
| + if (scope.element.kind == ElementKind.VARIABLE_LIST) { |
| + compiler.internalError("Bad enclosing element", node: node); |
| + } |
| + Element functionEnclosing = scope.element; |
|
ahe
2012/10/11 07:36:05
How about moving this assignment above the if stat
floitsch
2012/10/11 13:58:12
Done.
|
| + if (functionEnclosing.isLibrary()) { |
| + // We are in a static initializers. |
| + functionEnclosing = enclosingElement; |
|
ahe
2012/10/11 07:36:05
This is not making any sense to me.
floitsch
2012/10/11 13:58:12
Added comments and a TODO(ahe).
|
| + } |
| FunctionElement enclosing = new FunctionElement.node( |
| name, node, ElementKind.FUNCTION, Modifiers.EMPTY, |
| - scope.element); |
| + functionEnclosing); |
| setupFunction(node, enclosing); |
| defineElement(node, enclosing, doAddToScope: node.name !== null); |