Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1701413005: Fix for making variable initializer synthetic. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698