| 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 test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 } | 887 } |
| 888 | 888 |
| 889 void compareVariableInitializers( | 889 void compareVariableInitializers( |
| 890 FunctionElement resynthesized, FunctionElement original, String desc) { | 890 FunctionElement resynthesized, FunctionElement original, String desc) { |
| 891 if (original == null && resynthesized == null) { | 891 if (original == null && resynthesized == null) { |
| 892 return; | 892 return; |
| 893 } | 893 } |
| 894 expect(resynthesized, isNotNull, reason: desc); | 894 expect(resynthesized, isNotNull, reason: desc); |
| 895 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); | 895 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); |
| 896 expect(resynthesized.name, original.name, reason: desc); | 896 expect(resynthesized.name, original.name, reason: desc); |
| 897 expect(resynthesized.isSynthetic, original.isSynthetic, reason: desc); |
| 897 // TODO(scheglov) replace this method with compareFunctionElements() | 898 // TODO(scheglov) replace this method with compareFunctionElements() |
| 898 // once we resynthesize initializers return types. | 899 // once we resynthesize initializers return types. |
| 899 } | 900 } |
| 900 | 901 |
| 901 /** | 902 /** |
| 902 * Serialize the given [library] into a summary. Then create a | 903 * Serialize the given [library] into a summary. Then create a |
| 903 * [_TestSummaryResynthesizer] which can deserialize it, along with any | 904 * [_TestSummaryResynthesizer] which can deserialize it, along with any |
| 904 * references it makes to `dart:core`. | 905 * references it makes to `dart:core`. |
| 905 * | 906 * |
| 906 * Errors will lead to a test failure unless [allowErrors] is `true`. | 907 * Errors will lead to a test failure unless [allowErrors] is `true`. |
| (...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3695 fail('Unexpectedly tried to get unlinked summary for $uri'); | 3696 fail('Unexpectedly tried to get unlinked summary for $uri'); |
| 3696 } | 3697 } |
| 3697 return serializedUnit; | 3698 return serializedUnit; |
| 3698 } | 3699 } |
| 3699 | 3700 |
| 3700 @override | 3701 @override |
| 3701 bool hasLibrarySummary(String uri) { | 3702 bool hasLibrarySummary(String uri) { |
| 3702 return true; | 3703 return true; |
| 3703 } | 3704 } |
| 3704 } | 3705 } |
| OLD | NEW |