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

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

Issue 2987883003: Resynthesize top-level accessors and variables from Kernel. (Closed)
Patch Set: Created 3 years, 4 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:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 abstract class C { 2033 abstract class C {
2034 int get x; 2034 int get x;
2035 } 2035 }
2036 '''); 2036 ''');
2037 } 2037 }
2038 2038
2039 test_class_getter_external() async { 2039 test_class_getter_external() async {
2040 var library = await checkLibrary('class C { external int get x; }'); 2040 var library = await checkLibrary('class C { external int get x; }');
2041 checkElementText(library, r''' 2041 checkElementText(library, r'''
2042 class C { 2042 class C {
2043 external int get x {} 2043 external int get x;
2044 } 2044 }
2045 '''); 2045 ''');
2046 } 2046 }
2047 2047
2048 test_class_getter_implicit_return_type() async { 2048 test_class_getter_implicit_return_type() async {
2049 var library = await checkLibrary('class C { get x => null; }'); 2049 var library = await checkLibrary('class C { get x => null; }');
2050 checkElementText(library, r''' 2050 checkElementText(library, r'''
2051 class C { 2051 class C {
2052 dynamic get x {} 2052 dynamic get x {}
2053 } 2053 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 void set x(int value); 2246 void set x(int value);
2247 } 2247 }
2248 '''); 2248 ''');
2249 } 2249 }
2250 2250
2251 test_class_setter_external() async { 2251 test_class_setter_external() async {
2252 var library = 2252 var library =
2253 await checkLibrary('class C { external void set x(int value); }'); 2253 await checkLibrary('class C { external void set x(int value); }');
2254 checkElementText(library, r''' 2254 checkElementText(library, r'''
2255 class C { 2255 class C {
2256 external void set x(int value) {} 2256 external void set x(int value);
2257 } 2257 }
2258 '''); 2258 ''');
2259 } 2259 }
2260 2260
2261 test_class_setter_implicit_param_type() async { 2261 test_class_setter_implicit_param_type() async {
2262 var library = await checkLibrary('class C { void set x(value) {} }'); 2262 var library = await checkLibrary('class C { void set x(value) {} }');
2263 checkElementText(library, r''' 2263 checkElementText(library, r'''
2264 class C { 2264 class C {
2265 void set x(dynamic value) {} 2265 void set x(dynamic value) {}
2266 } 2266 }
(...skipping 3978 matching lines...) Expand 10 before | Expand all | Expand 10 after
6245 /** 6245 /**
6246 * Docs 6246 * Docs
6247 */ 6247 */
6248 dynamic get x {} 6248 dynamic get x {}
6249 '''); 6249 ''');
6250 } 6250 }
6251 6251
6252 test_getter_external() async { 6252 test_getter_external() async {
6253 var library = await checkLibrary('external int get x;'); 6253 var library = await checkLibrary('external int get x;');
6254 checkElementText(library, r''' 6254 checkElementText(library, r'''
6255 external int get x {} 6255 external int get x;
6256 '''); 6256 ''');
6257 } 6257 }
6258 6258
6259 test_getter_inferred_type_nonStatic_implicit_return() async { 6259 test_getter_inferred_type_nonStatic_implicit_return() async {
6260 var library = await checkLibrary( 6260 var library = await checkLibrary(
6261 'class C extends D { get f => null; } abstract class D { int get f; }'); 6261 'class C extends D { get f => null; } abstract class D { int get f; }');
6262 if (isStrongMode) { 6262 if (isStrongMode) {
6263 checkElementText(library, r''' 6263 checkElementText(library, r'''
6264 class C extends D { 6264 class C extends D {
6265 int get f {} 6265 int get f {}
(...skipping 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after
8714 /** 8714 /**
8715 * Docs 8715 * Docs
8716 */ 8716 */
8717 void set x(dynamic value) {} 8717 void set x(dynamic value) {}
8718 '''); 8718 ''');
8719 } 8719 }
8720 8720
8721 test_setter_external() async { 8721 test_setter_external() async {
8722 var library = await checkLibrary('external void set x(int value);'); 8722 var library = await checkLibrary('external void set x(int value);');
8723 checkElementText(library, r''' 8723 checkElementText(library, r'''
8724 external void set x(int value) {} 8724 external void set x(int value);
8725 '''); 8725 ''');
8726 } 8726 }
8727 8727
8728 test_setter_inferred_type_nonStatic_implicit_param() async { 8728 test_setter_inferred_type_nonStatic_implicit_param() async {
8729 var library = 8729 var library =
8730 await checkLibrary('class C extends D { void set f(value) {} }' 8730 await checkLibrary('class C extends D { void set f(value) {} }'
8731 ' abstract class D { void set f(int value); }'); 8731 ' abstract class D { void set f(int value); }');
8732 if (isStrongMode) { 8732 if (isStrongMode) {
8733 checkElementText(library, r''' 8733 checkElementText(library, r'''
8734 class C extends D { 8734 class C extends D {
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
10008 fail('Unexpectedly tried to get unlinked summary for $uri'); 10008 fail('Unexpectedly tried to get unlinked summary for $uri');
10009 } 10009 }
10010 return serializedUnit; 10010 return serializedUnit;
10011 } 10011 }
10012 10012
10013 @override 10013 @override
10014 bool hasLibrarySummary(String uri) { 10014 bool hasLibrarySummary(String uri) {
10015 return true; 10015 return true;
10016 } 10016 }
10017 } 10017 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698