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 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.isParameter) { | 2568 if (element.isParameter) { |
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 && |
| 2577 compiler.options.enableInitializingFormalAccess) { |
| 2578 error = reportAndCreateErroneousElement(node.selector, name.text, |
| 2579 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); |
| 2580 semantics = new StaticAccess.finalParameter(element); |
2576 } else if (element.isVariable) { | 2581 } else if (element.isVariable) { |
2577 if (element.isFinal || element.isConst) { | 2582 if (element.isFinal || element.isConst) { |
2578 error = reportAndCreateErroneousElement(node.selector, name.text, | 2583 error = reportAndCreateErroneousElement(node.selector, name.text, |
2579 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); | 2584 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, {'name': name}); |
2580 semantics = new StaticAccess.finalLocalVariable(element); | 2585 semantics = new StaticAccess.finalLocalVariable(element); |
2581 } else { | 2586 } else { |
2582 semantics = new StaticAccess.localVariable(element); | 2587 semantics = new StaticAccess.localVariable(element); |
2583 } | 2588 } |
2584 } else { | 2589 } else { |
2585 assert(invariant(node, element.isFunction, | 2590 assert(invariant(node, element.isFunction, |
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4726 } | 4731 } |
4727 return const NoneResult(); | 4732 return const NoneResult(); |
4728 } | 4733 } |
4729 } | 4734 } |
4730 | 4735 |
4731 /// Looks up [name] in [scope] and unwraps the result. | 4736 /// Looks up [name] in [scope] and unwraps the result. |
4732 Element lookupInScope( | 4737 Element lookupInScope( |
4733 DiagnosticReporter reporter, Node node, Scope scope, String name) { | 4738 DiagnosticReporter reporter, Node node, Scope scope, String name) { |
4734 return Elements.unwrap(scope.lookup(name), reporter, node); | 4739 return Elements.unwrap(scope.lookup(name), reporter, node); |
4735 } | 4740 } |
OLD | NEW |