| 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 | 8 import '../common/names.dart' show |
| 9 Selectors; | 9 Selectors; |
| 10 import '../common/resolution.dart' show | 10 import '../common/resolution.dart' show |
| (...skipping 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3008 } | 3008 } |
| 3009 if (element.isClass) { | 3009 if (element.isClass) { |
| 3010 // `C = b`, `C++`, or 'C += b` where 'C' is a class. | 3010 // `C = b`, `C++`, or 'C += b` where 'C' is a class. |
| 3011 return handleClassTypeLiteralUpdate(node, name, element); | 3011 return handleClassTypeLiteralUpdate(node, name, element); |
| 3012 } else if (element.isTypedef) { | 3012 } else if (element.isTypedef) { |
| 3013 // `C = b`, `C++`, or 'C += b` where 'F' is a typedef. | 3013 // `C = b`, `C++`, or 'C += b` where 'F' is a typedef. |
| 3014 return handleTypedefTypeLiteralUpdate(node, name, element); | 3014 return handleTypedefTypeLiteralUpdate(node, name, element); |
| 3015 } else if (element.isTypeVariable) { | 3015 } else if (element.isTypeVariable) { |
| 3016 // `T = b`, `T++`, or 'T += b` where 'T' is a type variable. | 3016 // `T = b`, `T++`, or 'T += b` where 'T' is a type variable. |
| 3017 return handleTypeVariableTypeLiteralUpdate(node, name, element); | 3017 return handleTypeVariableTypeLiteralUpdate(node, name, element); |
| 3018 } else if (element.isPrefix) { |
| 3019 // `p = b` where `p` is a prefix. |
| 3020 ErroneousElement error = reportAndCreateErroneousElement( |
| 3021 node, |
| 3022 name.text, |
| 3023 MessageKind.PREFIX_AS_EXPRESSION, |
| 3024 {'prefix': name}, |
| 3025 isError: true); |
| 3026 registry.registerFeature(Feature.COMPILE_TIME_ERROR); |
| 3027 return handleUpdate( |
| 3028 node, name, new StaticAccess.invalid(error)); |
| 3018 } else if (element.isLocal) { | 3029 } else if (element.isLocal) { |
| 3019 return handleLocalUpdate(node, name, element); | 3030 return handleLocalUpdate(node, name, element); |
| 3020 } else if (element.isStatic || element.isTopLevel) { | 3031 } else if (element.isStatic || element.isTopLevel) { |
| 3021 return handleStaticOrTopLevelUpdate(node, name, element); | 3032 return handleStaticOrTopLevelUpdate(node, name, element); |
| 3022 } | 3033 } |
| 3023 return reporter.internalError(node, "Unexpected resolved send: $element"); | 3034 return reporter.internalError(node, "Unexpected resolved send: $element"); |
| 3024 } | 3035 } |
| 3025 | 3036 |
| 3026 /// Handle an unqualified [Send], that is where the `node.receiver` is null, | 3037 /// Handle an unqualified [Send], that is where the `node.receiver` is null, |
| 3027 /// like `a`, `a()`, `this()`, `assert()`, and `(){}()`. | 3038 /// like `a`, `a()`, `this()`, `assert()`, and `(){}()`. |
| (...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4831 } | 4842 } |
| 4832 return const NoneResult(); | 4843 return const NoneResult(); |
| 4833 } | 4844 } |
| 4834 } | 4845 } |
| 4835 | 4846 |
| 4836 /// Looks up [name] in [scope] and unwraps the result. | 4847 /// Looks up [name] in [scope] and unwraps the result. |
| 4837 Element lookupInScope(DiagnosticReporter reporter, Node node, | 4848 Element lookupInScope(DiagnosticReporter reporter, Node node, |
| 4838 Scope scope, String name) { | 4849 Scope scope, String name) { |
| 4839 return Elements.unwrap(scope.lookup(name), reporter, node); | 4850 return Elements.unwrap(scope.lookup(name), reporter, node); |
| 4840 } | 4851 } |
| OLD | NEW |