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.serialization; | 5 library dart2js.serialization; |
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 '../dart_types.dart'; | 10 import '../dart_types.dart'; |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 if (element == null) { | 685 if (element == null) { |
686 throw new ArgumentError('Serializer._getElementDataObject(null)'); | 686 throw new ArgumentError('Serializer._getElementDataObject(null)'); |
687 } | 687 } |
688 element = element.declaration; | 688 element = element.declaration; |
689 DataObject dataObject = _elementMap[element]; | 689 DataObject dataObject = _elementMap[element]; |
690 if (dataObject == null) { | 690 if (dataObject == null) { |
691 if (!shouldInclude(element)) { | 691 if (!shouldInclude(element)) { |
692 /// Helper used to check that external references are serialized by | 692 /// Helper used to check that external references are serialized by |
693 /// the right kind. | 693 /// the right kind. |
694 bool verifyElement(var found, var expected) { | 694 bool verifyElement(var found, var expected) { |
| 695 if (found == null) return false; |
695 found = found.declaration; | 696 found = found.declaration; |
696 if (found == expected) return true; | 697 if (found == expected) return true; |
697 if (found.isAbstractField && expected.isGetter) { | 698 if (found.isAbstractField && expected.isGetter) { |
698 return found.getter == expected; | 699 return found.getter == expected; |
699 } | 700 } |
700 if (found.isAbstractField && expected.isSetter) { | 701 if (found.isAbstractField && expected.isSetter) { |
701 return found.setter == expected; | 702 return found.setter == expected; |
702 } | 703 } |
703 return false; | 704 return false; |
704 } | 705 } |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 | 1130 |
1130 /// Returns the value used to store [key] as a property in the encoding an | 1131 /// Returns the value used to store [key] as a property in the encoding an |
1131 /// [ObjectValue]. | 1132 /// [ObjectValue]. |
1132 /// | 1133 /// |
1133 /// Different encodings have different restrictions and capabilities as how | 1134 /// Different encodings have different restrictions and capabilities as how |
1134 /// to store a [Key] value. For instance: A JSON encoding needs to convert | 1135 /// to store a [Key] value. For instance: A JSON encoding needs to convert |
1135 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can | 1136 /// [Key] to a [String] to store it in a JSON object; a Dart encoding can |
1136 /// choose to store a [Key] as an [int] or as the [Key] itself. | 1137 /// choose to store a [Key] as an [int] or as the [Key] itself. |
1137 getObjectPropertyValue(Key key); | 1138 getObjectPropertyValue(Key key); |
1138 } | 1139 } |
OLD | NEW |