| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart2js.semantics_visitor; | 5 part of dart2js.semantics_visitor; |
| 6 | 6 |
| 7 enum SendStructureKind { | 7 enum SendStructureKind { |
| 8 GET, | 8 GET, |
| 9 SET, | 9 SET, |
| 10 INVOKE, | 10 INVOKE, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 assert(invariant(node, getter != null, message: | 99 assert(invariant(node, getter != null, message: |
| 100 "Compound static access without element.")); | 100 "Compound static access without element.")); |
| 101 return handleCompoundErroneousSetterAccess(node, element, getter); | 101 return handleCompoundErroneousSetterAccess(node, element, getter); |
| 102 } | 102 } |
| 103 if (element.isErroneous) { | 103 if (element.isErroneous) { |
| 104 if (isCompound) { | 104 if (isCompound) { |
| 105 return handleCompoundErroneousSetterAccess(node, element, getter); | 105 return handleCompoundErroneousSetterAccess(node, element, getter); |
| 106 } | 106 } |
| 107 return new StaticAccess.unresolved(element); | 107 return new StaticAccess.unresolved(element); |
| 108 } else if (element.isParameter) { | 108 } else if (element.isParameter) { |
| 109 return new StaticAccess.parameter(element); | 109 if (element.isFinal) { |
| 110 return new StaticAccess.finalParameter(element); |
| 111 } else { |
| 112 return new StaticAccess.parameter(element); |
| 113 } |
| 110 } else if (element.isLocal) { | 114 } else if (element.isLocal) { |
| 111 if (element.isFunction) { | 115 if (element.isFunction) { |
| 112 return new StaticAccess.localFunction(element); | 116 return new StaticAccess.localFunction(element); |
| 117 } else if (element.isFinal || element.isConst) { |
| 118 return new StaticAccess.finalLocalVariable(element); |
| 113 } else { | 119 } else { |
| 114 return new StaticAccess.localVariable(element); | 120 return new StaticAccess.localVariable(element); |
| 115 } | 121 } |
| 116 } else if (element.isStatic) { | 122 } else if (element.isStatic) { |
| 117 if (element.isField) { | 123 if (element.isField) { |
| 118 if (element.isFinal || element.isConst) { | 124 if (element.isFinal || element.isConst) { |
| 119 // TODO(johnniwinther): Handle const field separately. | 125 // TODO(johnniwinther): Handle const field separately. |
| 120 return new StaticAccess.finalStaticField(element); | 126 return new StaticAccess.finalStaticField(element); |
| 121 } | 127 } |
| 122 return new StaticAccess.staticField(element); | 128 return new StaticAccess.staticField(element); |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 return internalError(node, "Unexpected variable $element."); | 937 return internalError(node, "Unexpected variable $element."); |
| 932 } | 938 } |
| 933 if (element.isConst) { | 939 if (element.isConst) { |
| 934 ConstantExpression constant = elements.getConstant(element.initializer); | 940 ConstantExpression constant = elements.getConstant(element.initializer); |
| 935 return new ConstantVariableStructure(kind, node, element, constant); | 941 return new ConstantVariableStructure(kind, node, element, constant); |
| 936 } else { | 942 } else { |
| 937 return new NonConstantVariableStructure(kind, node, element); | 943 return new NonConstantVariableStructure(kind, node, element); |
| 938 } | 944 } |
| 939 } | 945 } |
| 940 } | 946 } |
| OLD | NEW |