| OLD | NEW |
| 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 abstract class TreeElements { | 5 abstract class TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 DartType getType(TypeAnnotation annotation); | 8 DartType getType(TypeAnnotation annotation); |
| 9 bool isParameterChecked(Element element); | 9 bool isParameterChecked(Element element); |
| 10 } | 10 } |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 306 |
| 307 if (constructor.defaultImplementation === null) { | 307 if (constructor.defaultImplementation === null) { |
| 308 // We failed to find a constructor named either | 308 // We failed to find a constructor named either |
| 309 // "MyInterface.name" or "MyClass.name". | 309 // "MyInterface.name" or "MyClass.name". |
| 310 error(node, | 310 error(node, |
| 311 MessageKind.CANNOT_FIND_CONSTRUCTOR2, | 311 MessageKind.CANNOT_FIND_CONSTRUCTOR2, |
| 312 [name, defaultClass.name]); | 312 [name, defaultClass.name]); |
| 313 } | 313 } |
| 314 } | 314 } |
| 315 | 315 |
| 316 TreeElements resolveField(Element element) { | 316 TreeElements resolveField(VariableElement element) { |
| 317 Node tree = element.parseNode(compiler); | 317 Node tree = element.parseNode(compiler); |
| 318 if(element.modifiers.isStatic() && element.variables.isTopLevel()) { |
| 319 error(element.modifiers.getStatic(), MessageKind.TOP_LEVEL_VARIABLE_DECLAR
ED_STATIC); |
| 320 } |
| 318 ResolverVisitor visitor = new ResolverVisitor(compiler, element); | 321 ResolverVisitor visitor = new ResolverVisitor(compiler, element); |
| 319 initializerDo(tree, visitor.visit); | 322 initializerDo(tree, visitor.visit); |
| 320 return visitor.mapping; | 323 return visitor.mapping; |
| 321 } | 324 } |
| 322 | 325 |
| 323 TreeElements resolveParameter(Element element) { | 326 TreeElements resolveParameter(Element element) { |
| 324 Node tree = element.parseNode(compiler); | 327 Node tree = element.parseNode(compiler); |
| 325 ResolverVisitor visitor = | 328 ResolverVisitor visitor = |
| 326 new ResolverVisitor(compiler, element.enclosingElement); | 329 new ResolverVisitor(compiler, element.enclosingElement); |
| 327 initializerDo(tree, visitor.visit); | 330 initializerDo(tree, visitor.visit); |
| (...skipping 2811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3139 return result; | 3142 return result; |
| 3140 } | 3143 } |
| 3141 Element lookup(SourceString name) => localLookup(name); | 3144 Element lookup(SourceString name) => localLookup(name); |
| 3142 Element lexicalLookup(SourceString name) => localLookup(name); | 3145 Element lexicalLookup(SourceString name) => localLookup(name); |
| 3143 | 3146 |
| 3144 Element add(Element newElement) { | 3147 Element add(Element newElement) { |
| 3145 throw "Cannot add an element in a patch library scope"; | 3148 throw "Cannot add an element in a patch library scope"; |
| 3146 } | 3149 } |
| 3147 String toString() => 'PatchLibraryScope($origin,$patch)'; | 3150 String toString() => 'PatchLibraryScope($origin,$patch)'; |
| 3148 } | 3151 } |
| OLD | NEW |