| 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 library dart2js.semantics_visitor.resolver; | 5 library dart2js.semantics_visitor.resolver; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../elements/resolution_types.dart'; | 9 import '../elements/resolution_types.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 INSTANCE_METHOD, | 87 INSTANCE_METHOD, |
| 88 LOCAL_FUNCTION, | 88 LOCAL_FUNCTION, |
| 89 CLOSURE, | 89 CLOSURE, |
| 90 } | 90 } |
| 91 | 91 |
| 92 class FunctionDeclStructure<R, A> extends DeclStructure<R, A> { | 92 class FunctionDeclStructure<R, A> extends DeclStructure<R, A> { |
| 93 final FunctionKind kind; | 93 final FunctionKind kind; |
| 94 | 94 |
| 95 FunctionDeclStructure(this.kind, FunctionElement function) : super(function); | 95 FunctionDeclStructure(this.kind, FunctionElement function) : super(function); |
| 96 | 96 |
| 97 // ignore: MISSING_RETURN |
| 97 R dispatch(SemanticDeclarationVisitor<R, A> visitor, FunctionExpression node, | 98 R dispatch(SemanticDeclarationVisitor<R, A> visitor, FunctionExpression node, |
| 98 A arg) { | 99 A arg) { |
| 99 switch (kind) { | 100 switch (kind) { |
| 100 case FunctionKind.TOP_LEVEL_GETTER: | 101 case FunctionKind.TOP_LEVEL_GETTER: |
| 101 return visitor.visitTopLevelGetterDeclaration( | 102 return visitor.visitTopLevelGetterDeclaration( |
| 102 node, element, node.body, arg); | 103 node, element, node.body, arg); |
| 103 case FunctionKind.TOP_LEVEL_SETTER: | 104 case FunctionKind.TOP_LEVEL_SETTER: |
| 104 return visitor.visitTopLevelSetterDeclaration( | 105 return visitor.visitTopLevelSetterDeclaration( |
| 105 node, element, node.parameters, node.body, arg); | 106 node, element, node.parameters, node.body, arg); |
| 106 case FunctionKind.TOP_LEVEL_FUNCTION: | 107 case FunctionKind.TOP_LEVEL_FUNCTION: |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return internalError(node, "Unexpected variable $element."); | 329 return internalError(node, "Unexpected variable $element."); |
| 329 } | 330 } |
| 330 if (element.isConst) { | 331 if (element.isConst) { |
| 331 ConstantExpression constant = elements.getConstant(element.initializer); | 332 ConstantExpression constant = elements.getConstant(element.initializer); |
| 332 return new ConstantVariableStructure(kind, node, element, constant); | 333 return new ConstantVariableStructure(kind, node, element, constant); |
| 333 } else { | 334 } else { |
| 334 return new NonConstantVariableStructure(kind, node, element); | 335 return new NonConstantVariableStructure(kind, node, element); |
| 335 } | 336 } |
| 336 } | 337 } |
| 337 } | 338 } |
| OLD | NEW |