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 Resolution; | 9 import '../common/resolution.dart' show Resolution; |
10 import '../compile_time_constants.dart'; | 10 import '../compile_time_constants.dart'; |
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 AccessSemantics semantics; | 2566 AccessSemantics semantics; |
2567 ErroneousElement error; | 2567 ErroneousElement error; |
2568 if (element.isRegularParameter) { | 2568 if (element.isRegularParameter) { |
2569 if (element.isFinal) { | 2569 if (element.isFinal) { |
2570 error = reportAndCreateErroneousElement(node.selector, name.text, | 2570 error = reportAndCreateErroneousElement(node.selector, name.text, |
2571 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); | 2571 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); |
2572 semantics = new StaticAccess.finalParameter(element); | 2572 semantics = new StaticAccess.finalParameter(element); |
2573 } else { | 2573 } else { |
2574 semantics = new StaticAccess.parameter(element); | 2574 semantics = new StaticAccess.parameter(element); |
2575 } | 2575 } |
2576 } else if (element.isInitializingFormal && | 2576 } else if (element.isInitializingFormal) { |
2577 options.enableInitializingFormalAccess) { | |
2578 error = reportAndCreateErroneousElement(node.selector, name.text, | 2577 error = reportAndCreateErroneousElement(node.selector, name.text, |
2579 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); | 2578 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); |
2580 semantics = new StaticAccess.finalParameter(element); | 2579 semantics = new StaticAccess.finalParameter(element); |
2581 } else if (element.isVariable) { | 2580 } else if (element.isVariable) { |
2582 if (element.isFinal || element.isConst) { | 2581 if (element.isFinal || element.isConst) { |
2583 error = reportAndCreateErroneousElement(node.selector, name.text, | 2582 error = reportAndCreateErroneousElement(node.selector, name.text, |
2584 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); | 2583 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); |
2585 semantics = new StaticAccess.finalLocalVariable(element); | 2584 semantics = new StaticAccess.finalLocalVariable(element); |
2586 } else { | 2585 } else { |
2587 semantics = new StaticAccess.localVariable(element); | 2586 semantics = new StaticAccess.localVariable(element); |
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4746 } | 4745 } |
4747 return const NoneResult(); | 4746 return const NoneResult(); |
4748 } | 4747 } |
4749 } | 4748 } |
4750 | 4749 |
4751 /// Looks up [name] in [scope] and unwraps the result. | 4750 /// Looks up [name] in [scope] and unwraps the result. |
4752 Element lookupInScope( | 4751 Element lookupInScope( |
4753 DiagnosticReporter reporter, Node node, Scope scope, String name) { | 4752 DiagnosticReporter reporter, Node node, Scope scope, String name) { |
4754 return Elements.unwrap(scope.lookup(name), reporter, node); | 4753 return Elements.unwrap(scope.lookup(name), reporter, node); |
4755 } | 4754 } |
OLD | NEW |