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

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

Issue 1855483003: Store initializer expressions for untyped vars/fields in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
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/constant/value.dart'; 10 import 'package:analyzer/dart/constant/value.dart';
(...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after
2837 }'''); 2837 }''');
2838 } 2838 }
2839 2839
2840 test_field_propagatedType_final_noDep_static() { 2840 test_field_propagatedType_final_noDep_static() {
2841 checkLibrary(''' 2841 checkLibrary('''
2842 class C { 2842 class C {
2843 static final x = 0; 2843 static final x = 0;
2844 }'''); 2844 }''');
2845 } 2845 }
2846 2846
2847 test_field_static_final_untyped() {
2848 checkLibrary('class C { static final x = 0; }');
2849 }
2850
2851 test_field_untyped() {
2852 checkLibrary('class C { var x = 0; }');
2853 }
2854
2847 test_function_documented() { 2855 test_function_documented() {
2848 checkLibrary(''' 2856 checkLibrary('''
2849 // Extra comment so doc comment offset != 0 2857 // Extra comment so doc comment offset != 0
2850 /** 2858 /**
2851 * Docs 2859 * Docs
2852 */ 2860 */
2853 f() {}'''); 2861 f() {}''');
2854 } 2862 }
2855 2863
2856 test_function_entry_point() { 2864 test_function_entry_point() {
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
4098 /** 4106 /**
4099 * Docs 4107 * Docs
4100 */ 4108 */
4101 var x;'''); 4109 var x;''');
4102 } 4110 }
4103 4111
4104 test_variable_final() { 4112 test_variable_final() {
4105 checkLibrary('final int x = 0;'); 4113 checkLibrary('final int x = 0;');
4106 } 4114 }
4107 4115
4116 test_variable_final_top_level_untyped() {
4117 checkLibrary('final v = 0;');
4118 }
4119
4108 test_variable_getterInLib_setterInPart() { 4120 test_variable_getterInLib_setterInPart() {
4109 addSource('/a.dart', 'part of my.lib; void set x(int _) {}'); 4121 addSource('/a.dart', 'part of my.lib; void set x(int _) {}');
4110 checkLibrary('library my.lib; part "a.dart"; int get x => 42;'); 4122 checkLibrary('library my.lib; part "a.dart"; int get x => 42;');
4111 } 4123 }
4112 4124
4113 test_variable_getterInPart_setterInLib() { 4125 test_variable_getterInPart_setterInLib() {
4114 addSource('/a.dart', 'part of my.lib; int get x => 42;'); 4126 addSource('/a.dart', 'part of my.lib; int get x => 42;');
4115 checkLibrary('library my.lib; part "a.dart"; void set x(int _) {}'); 4127 checkLibrary('library my.lib; part "a.dart"; void set x(int _) {}');
4116 } 4128 }
4117 4129
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
4228 fail('Unexpectedly tried to get unlinked summary for $uri'); 4240 fail('Unexpectedly tried to get unlinked summary for $uri');
4229 } 4241 }
4230 return serializedUnit; 4242 return serializedUnit;
4231 } 4243 }
4232 4244
4233 @override 4245 @override
4234 bool hasLibrarySummary(String uri) { 4246 bool hasLibrarySummary(String uri) {
4235 return true; 4247 return true;
4236 } 4248 }
4237 } 4249 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698