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.parser.partial_elements; | 5 library dart2js.parser.partial_elements; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show | 8 import '../common/resolution.dart' show |
9 Parsing, | 9 Parsing, |
10 Resolution; | 10 Resolution; |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 }); | 291 }); |
292 return definitions; | 292 return definitions; |
293 } | 293 } |
294 | 294 |
295 computeType(Element element, Resolution resolution) { | 295 computeType(Element element, Resolution resolution) { |
296 if (type != null) return type; | 296 if (type != null) return type; |
297 // TODO(johnniwinther): Compute this in the resolver. | 297 // TODO(johnniwinther): Compute this in the resolver. |
298 VariableDefinitions node = parseNode(element, resolution.parsing); | 298 VariableDefinitions node = parseNode(element, resolution.parsing); |
299 if (node.type != null) { | 299 if (node.type != null) { |
300 type = resolution.resolveTypeAnnotation(element, node.type); | 300 type = resolution.reporter.withCurrentElement(element, () { |
| 301 return resolution.resolveTypeAnnotation(element, node.type); |
| 302 }); |
301 } else { | 303 } else { |
302 type = const DynamicType(); | 304 type = const DynamicType(); |
303 } | 305 } |
304 assert(type != null); | 306 assert(type != null); |
305 return type; | 307 return type; |
306 } | 308 } |
307 } | 309 } |
308 | 310 |
309 class PartialTypedefElement extends TypedefElementX with PartialElement { | 311 class PartialTypedefElement extends TypedefElementX with PartialElement { |
310 | 312 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 } on ParserError catch (e) { | 495 } on ParserError catch (e) { |
494 partial.hasParseError = true; | 496 partial.hasParseError = true; |
495 return new ErrorNode(element.position, e.reason); | 497 return new ErrorNode(element.position, e.reason); |
496 } | 498 } |
497 Node node = listener.popNode(); | 499 Node node = listener.popNode(); |
498 assert(listener.nodes.isEmpty); | 500 assert(listener.nodes.isEmpty); |
499 return node; | 501 return node; |
500 }); | 502 }); |
501 }); | 503 }); |
502 } | 504 } |
OLD | NEW |