| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show | 8 import '../common/resolution.dart' show |
| 9 Resolution, | 9 Resolution, |
| 10 Parsing; | 10 Parsing; |
| (...skipping 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 : super(name, kind, modifiers, enclosing); | 2108 : super(name, kind, modifiers, enclosing); |
| 2109 | 2109 |
| 2110 MemberElement get memberContext => this; | 2110 MemberElement get memberContext => this; |
| 2111 | 2111 |
| 2112 @override | 2112 @override |
| 2113 SourceSpan get sourcePosition { | 2113 SourceSpan get sourcePosition { |
| 2114 SourceSpan span = super.sourcePosition; | 2114 SourceSpan span = super.sourcePosition; |
| 2115 if (span != null && hasNode) { | 2115 if (span != null && hasNode) { |
| 2116 FunctionExpression functionExpression = node.asFunctionExpression(); | 2116 FunctionExpression functionExpression = node.asFunctionExpression(); |
| 2117 if (functionExpression != null) { | 2117 if (functionExpression != null) { |
| 2118 Token begin = functionExpression.getBeginToken(); | 2118 span = new SourceSpan.fromNode(span.uri, functionExpression); |
| 2119 Token end; | |
| 2120 if (functionExpression.parameters != null) { | |
| 2121 end = functionExpression.parameters.getEndToken(); | |
| 2122 } else { | |
| 2123 end = functionExpression.name.getEndToken(); | |
| 2124 } | |
| 2125 span = new SourceSpan.fromTokens(span.uri, begin, end); | |
| 2126 } | 2119 } |
| 2127 } | 2120 } |
| 2128 return span; | 2121 return span; |
| 2129 } | 2122 } |
| 2130 | 2123 |
| 2131 void reuseElement() { | 2124 void reuseElement() { |
| 2132 super.reuseElement(); | 2125 super.reuseElement(); |
| 2133 nestedClosures.clear(); | 2126 nestedClosures.clear(); |
| 2134 _functionSignatureCache = null; | 2127 _functionSignatureCache = null; |
| 2135 typeCache = null; | 2128 typeCache = null; |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3228 AstElement get definingElement; | 3221 AstElement get definingElement; |
| 3229 | 3222 |
| 3230 bool get hasResolvedAst => definingElement.hasTreeElements; | 3223 bool get hasResolvedAst => definingElement.hasTreeElements; |
| 3231 | 3224 |
| 3232 ResolvedAst get resolvedAst { | 3225 ResolvedAst get resolvedAst { |
| 3233 return new ResolvedAst(declaration, | 3226 return new ResolvedAst(declaration, |
| 3234 definingElement.node, definingElement.treeElements); | 3227 definingElement.node, definingElement.treeElements); |
| 3235 } | 3228 } |
| 3236 | 3229 |
| 3237 } | 3230 } |
| OLD | NEW |