OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.resolver; | 5 library engine.resolver; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import '../task/strong/info.dart' show InferredType, StaticInfo; | 9 import '../task/strong/info.dart' show InferredType, StaticInfo; |
10 import '../task/strong/rules.dart' show TypeRules; | 10 import '../task/strong/rules.dart' show TypeRules; |
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2147 sc.Token property = node.propertyKeyword; | 2147 sc.Token property = node.propertyKeyword; |
2148 if (property == null) { | 2148 if (property == null) { |
2149 if (_enclosingExecutable != null) { | 2149 if (_enclosingExecutable != null) { |
2150 _enclosingExecutable = | 2150 _enclosingExecutable = |
2151 _findIdentifier(_enclosingExecutable.functions, functionName); | 2151 _findIdentifier(_enclosingExecutable.functions, functionName); |
2152 } else { | 2152 } else { |
2153 _enclosingExecutable = | 2153 _enclosingExecutable = |
2154 _findIdentifier(_enclosingUnit.functions, functionName); | 2154 _findIdentifier(_enclosingUnit.functions, functionName); |
2155 } | 2155 } |
2156 } else { | 2156 } else { |
2157 PropertyAccessorElement accessor = | 2157 if (_enclosingExecutable != null) { |
2158 _findIdentifier(_enclosingUnit.accessors, functionName); | 2158 _enclosingExecutable = |
2159 if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) { | 2159 _findIdentifier(_enclosingExecutable.functions, functionName); |
2160 accessor = accessor.variable.setter; | 2160 } else { |
2161 functionName.staticElement = accessor; | 2161 PropertyAccessorElement accessor = |
| 2162 _findIdentifier(_enclosingUnit.accessors, functionName); |
| 2163 if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) { |
| 2164 accessor = accessor.variable.setter; |
| 2165 functionName.staticElement = accessor; |
| 2166 } |
| 2167 _enclosingExecutable = accessor; |
2162 } | 2168 } |
2163 _enclosingExecutable = accessor; | |
2164 } | 2169 } |
2165 node.functionExpression.element = _enclosingExecutable; | 2170 node.functionExpression.element = _enclosingExecutable; |
2166 return super.visitFunctionDeclaration(node); | 2171 return super.visitFunctionDeclaration(node); |
2167 } finally { | 2172 } finally { |
2168 _enclosingExecutable = outerExecutable; | 2173 _enclosingExecutable = outerExecutable; |
2169 } | 2174 } |
2170 } | 2175 } |
2171 | 2176 |
2172 @override | 2177 @override |
2173 Object visitFunctionExpression(FunctionExpression node) { | 2178 Object visitFunctionExpression(FunctionExpression node) { |
(...skipping 13895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16069 nonFields.add(node); | 16074 nonFields.add(node); |
16070 return null; | 16075 return null; |
16071 } | 16076 } |
16072 | 16077 |
16073 @override | 16078 @override |
16074 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 16079 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
16075 | 16080 |
16076 @override | 16081 @override |
16077 Object visitWithClause(WithClause node) => null; | 16082 Object visitWithClause(WithClause node) => null; |
16078 } | 16083 } |
OLD | NEW |