| 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 /// Implementation of the element model used for deserialiation. | 5 /// Implementation of the element model used for deserialiation. |
| 6 /// | 6 /// |
| 7 /// These classes are created by [ElementDeserializer] triggered by the | 7 /// These classes are created by [ElementDeserializer] triggered by the |
| 8 /// [Deserializer]. | 8 /// [Deserializer]. |
| 9 | 9 |
| 10 library dart2js.serialization.modelz; | 10 library dart2js.serialization.modelz; |
| 11 | 11 |
| 12 import '../common.dart'; | 12 import '../common.dart'; |
| 13 import '../common/resolution.dart' show Resolution; | 13 import '../common/resolution.dart' show Resolution; |
| 14 import '../constants/constructors.dart'; | 14 import '../constants/constructors.dart'; |
| 15 import '../constants/expressions.dart'; | 15 import '../constants/expressions.dart'; |
| 16 import '../elements/resolution_types.dart'; | 16 import '../elements/resolution_types.dart'; |
| 17 import '../elements/common.dart'; | 17 import '../elements/common.dart'; |
| 18 import '../elements/elements.dart'; | 18 import '../elements/elements.dart'; |
| 19 import '../elements/entities.dart'; |
| 19 import '../elements/modelx.dart' show FunctionSignatureX; | 20 import '../elements/modelx.dart' show FunctionSignatureX; |
| 20 import '../elements/visitor.dart'; | 21 import '../elements/visitor.dart'; |
| 21 import '../io/source_file.dart'; | 22 import '../io/source_file.dart'; |
| 22 import '../ordered_typeset.dart'; | 23 import '../ordered_typeset.dart'; |
| 23 import '../resolution/class_members.dart' as class_members; | 24 import '../resolution/class_members.dart' as class_members; |
| 24 import '../resolution/scope.dart' show Scope; | 25 import '../resolution/scope.dart' show Scope; |
| 25 import '../resolution/tree_elements.dart' show TreeElements; | 26 import '../resolution/tree_elements.dart' show TreeElements; |
| 26 import '../script.dart'; | 27 import '../script.dart'; |
| 27 import '../serialization/constant_serialization.dart'; | 28 import '../serialization/constant_serialization.dart'; |
| 28 import 'package:front_end/src/fasta/scanner.dart' show Token; | 29 import 'package:front_end/src/fasta/scanner.dart' show Token; |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 } | 844 } |
| 844 return _functionSignature; | 845 return _functionSignature; |
| 845 } | 846 } |
| 846 | 847 |
| 847 List<ParameterElement> get parameters { | 848 List<ParameterElement> get parameters { |
| 848 if (_parameters == null) { | 849 if (_parameters == null) { |
| 849 _parameters = _decoder.getElements(Key.PARAMETERS, isOptional: true); | 850 _parameters = _decoder.getElements(Key.PARAMETERS, isOptional: true); |
| 850 } | 851 } |
| 851 return _parameters; | 852 return _parameters; |
| 852 } | 853 } |
| 854 |
| 855 ParameterStructure get parameterStructure => |
| 856 functionSignature.parameterStructure; |
| 853 } | 857 } |
| 854 | 858 |
| 855 abstract class FunctionTypedElementMixin | 859 abstract class FunctionTypedElementMixin |
| 856 implements FunctionElement, DeserializedElementZ { | 860 implements FunctionElement, DeserializedElementZ { |
| 857 @override | 861 @override |
| 858 FunctionElement asFunctionElement() => this; | 862 FunctionElement asFunctionElement() => this; |
| 859 | 863 |
| 860 @override | 864 @override |
| 861 bool get isExternal { | 865 bool get isExternal { |
| 862 return _decoder.getBool(Key.IS_EXTERNAL, | 866 return _decoder.getBool(Key.IS_EXTERNAL, |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 Element get enclosingElement => enclosingClass; | 1470 Element get enclosingElement => enclosingClass; |
| 1467 | 1471 |
| 1468 @override | 1472 @override |
| 1469 FunctionSignature get functionSignature { | 1473 FunctionSignature get functionSignature { |
| 1470 // TODO(johnniwinther): Ensure that the function signature (and with it the | 1474 // TODO(johnniwinther): Ensure that the function signature (and with it the |
| 1471 // function type) substitutes type variables correctly. | 1475 // function type) substitutes type variables correctly. |
| 1472 return definingConstructor.functionSignature; | 1476 return definingConstructor.functionSignature; |
| 1473 } | 1477 } |
| 1474 | 1478 |
| 1475 @override | 1479 @override |
| 1480 ParameterStructure get parameterStructure { |
| 1481 return functionSignature.parameterStructure; |
| 1482 } |
| 1483 |
| 1484 @override |
| 1476 bool get hasFunctionSignature { | 1485 bool get hasFunctionSignature { |
| 1477 return _unsupported('hasFunctionSignature'); | 1486 return _unsupported('hasFunctionSignature'); |
| 1478 } | 1487 } |
| 1479 | 1488 |
| 1480 @override | 1489 @override |
| 1481 ConstructorElement get immediateRedirectionTarget => null; | 1490 ConstructorElement get immediateRedirectionTarget => null; |
| 1482 | 1491 |
| 1483 @override | 1492 @override |
| 1484 bool get isCyclicRedirection => false; | 1493 bool get isCyclicRedirection => false; |
| 1485 | 1494 |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2402 } | 2411 } |
| 2403 | 2412 |
| 2404 @override | 2413 @override |
| 2405 Node get node => throw new UnsupportedError('${this}.node'); | 2414 Node get node => throw new UnsupportedError('${this}.node'); |
| 2406 | 2415 |
| 2407 @override | 2416 @override |
| 2408 bool get hasNode => false; | 2417 bool get hasNode => false; |
| 2409 | 2418 |
| 2410 String toString() => 'MetadataAnnotationZ(${constant.toDartText()})'; | 2419 String toString() => 'MetadataAnnotationZ(${constant.toDartText()})'; |
| 2411 } | 2420 } |
| OLD | NEW |