| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.serialization.resolved_ast; | 5 library dart2js.serialization.resolved_ast; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart'; | 8 import '../common/resolution.dart'; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../elements/resolution_types.dart'; | 10 import '../elements/resolution_types.dart'; |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 parse(parser); | 403 parse(parser); |
| 404 } on ParserError catch (e) { | 404 } on ParserError catch (e) { |
| 405 reporter.internalError(element, '$e'); | 405 reporter.internalError(element, '$e'); |
| 406 } | 406 } |
| 407 return listener.popNode(); | 407 return listener.popNode(); |
| 408 }); | 408 }); |
| 409 }); | 409 }); |
| 410 } | 410 } |
| 411 | 411 |
| 412 /// Computes the [Node] for the element based on the [AstKind]. | 412 /// Computes the [Node] for the element based on the [AstKind]. |
| 413 // ignore: MISSING_RETURN |
| 413 Node computeNode(AstKind kind) { | 414 Node computeNode(AstKind kind) { |
| 414 switch (kind) { | 415 switch (kind) { |
| 415 case AstKind.ENUM_INDEX_FIELD: | 416 case AstKind.ENUM_INDEX_FIELD: |
| 416 AstBuilder builder = new AstBuilder(element.sourcePosition.begin); | 417 AstBuilder builder = new AstBuilder(element.sourcePosition.begin); |
| 417 Identifier identifier = builder.identifier('index'); | 418 Identifier identifier = builder.identifier('index'); |
| 418 VariableDefinitions node = new VariableDefinitions( | 419 VariableDefinitions node = new VariableDefinitions( |
| 419 null, | 420 null, |
| 420 builder.modifiers(isFinal: true), | 421 builder.modifiers(isFinal: true), |
| 421 new NodeList.singleton(identifier)); | 422 new NodeList.singleton(identifier)); |
| 422 return node; | 423 return node; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 } | 699 } |
| 699 } | 700 } |
| 700 } | 701 } |
| 701 element.resolvedAst = | 702 element.resolvedAst = |
| 702 new ParsedResolvedAst(element, root, body, elements, uri); | 703 new ParsedResolvedAst(element, root, body, elements, uri); |
| 703 } | 704 } |
| 704 } | 705 } |
| 705 | 706 |
| 706 const Key PARAMETER_NODE = const Key('parameter.node'); | 707 const Key PARAMETER_NODE = const Key('parameter.node'); |
| 707 const Key PARAMETER_INITIALIZER = const Key('parameter.initializer'); | 708 const Key PARAMETER_INITIALIZER = const Key('parameter.initializer'); |
| OLD | NEW |