| 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 library dart2js.resolution.members; | 5 library dart2js.resolution.members; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart' show Selectors; | 8 import '../common/names.dart' show Selectors; |
| 9 import '../common/resolution.dart' show Feature; | 9 import '../common/resolution.dart' show Feature; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 4276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4287 new Selector.setter(new Name(identifier.source, library)); | 4287 new Selector.setter(new Name(identifier.source, library)); |
| 4288 loopVariable = registry.getDefinition(identifier); | 4288 loopVariable = registry.getDefinition(identifier); |
| 4289 } | 4289 } |
| 4290 } else { | 4290 } else { |
| 4291 reporter.reportErrorMessage(declaration, MessageKind.INVALID_FOR_IN); | 4291 reporter.reportErrorMessage(declaration, MessageKind.INVALID_FOR_IN); |
| 4292 } | 4292 } |
| 4293 if (loopVariableSelector != null) { | 4293 if (loopVariableSelector != null) { |
| 4294 registry.setSelector(declaration, loopVariableSelector); | 4294 registry.setSelector(declaration, loopVariableSelector); |
| 4295 if (loopVariable == null || loopVariable.isInstanceMember) { | 4295 if (loopVariable == null || loopVariable.isInstanceMember) { |
| 4296 registry.registerDynamicUse(new DynamicUse(loopVariableSelector, null)); | 4296 registry.registerDynamicUse(new DynamicUse(loopVariableSelector, null)); |
| 4297 } else if (loopVariable.impliesType) { |
| 4298 reporter.reportErrorMessage(declaration, MessageKind.INVALID_FOR_IN); |
| 4297 } else if (loopVariable.isStatic || loopVariable.isTopLevel) { | 4299 } else if (loopVariable.isStatic || loopVariable.isTopLevel) { |
| 4298 registry.registerStaticUse( | 4300 registry.registerStaticUse( |
| 4299 new StaticUse.staticSet(loopVariable.declaration)); | 4301 new StaticUse.staticSet(loopVariable.declaration)); |
| 4300 } | 4302 } |
| 4301 } else { | 4303 } else { |
| 4302 // The selector may only be null if we reported an error. | 4304 // The selector may only be null if we reported an error. |
| 4303 assert(invariant(declaration, compiler.compilationFailed)); | 4305 assert(invariant(declaration, compiler.compilationFailed)); |
| 4304 } | 4306 } |
| 4305 if (loopVariable != null) { | 4307 if (loopVariable != null) { |
| 4306 // loopVariable may be null if it could not be resolved. | 4308 // loopVariable may be null if it could not be resolved. |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4693 } | 4695 } |
| 4694 return const NoneResult(); | 4696 return const NoneResult(); |
| 4695 } | 4697 } |
| 4696 } | 4698 } |
| 4697 | 4699 |
| 4698 /// Looks up [name] in [scope] and unwraps the result. | 4700 /// Looks up [name] in [scope] and unwraps the result. |
| 4699 Element lookupInScope( | 4701 Element lookupInScope( |
| 4700 DiagnosticReporter reporter, Node node, Scope scope, String name) { | 4702 DiagnosticReporter reporter, Node node, Scope scope, String name) { |
| 4701 return Elements.unwrap(scope.lookup(name), reporter, node); | 4703 return Elements.unwrap(scope.lookup(name), reporter, node); |
| 4702 } | 4704 } |
| OLD | NEW |