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

Side by Side Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2685673004: Handle Creates and Returns annotations in KernelBehaviorBuilder (Closed)
Patch Set: Updated cf. comment Created 3 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 | « tests/compiler/dart2js/js_spec_string_test.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.kernel.impact_test; 5 library dart2js.kernel.impact_test;
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:compiler/src/commandline_options.dart'; 8 import 'package:compiler/src/commandline_options.dart';
9 import 'package:compiler/src/common.dart'; 9 import 'package:compiler/src/common.dart';
10 import 'package:compiler/src/common/names.dart'; 10 import 'package:compiler/src/common/names.dart';
(...skipping 15 matching lines...) Expand all
26 import 'package:expect/expect.dart'; 26 import 'package:expect/expect.dart';
27 import 'package:kernel/ast.dart' as ir; 27 import 'package:kernel/ast.dart' as ir;
28 import '../memory_compiler.dart'; 28 import '../memory_compiler.dart';
29 import '../serialization/test_helper.dart'; 29 import '../serialization/test_helper.dart';
30 30
31 const Map<String, String> SOURCE = const <String, String>{ 31 const Map<String, String> SOURCE = const <String, String>{
32 // Pretend this is a dart2js_native test to allow use of 'native' keyword. 32 // Pretend this is a dart2js_native test to allow use of 'native' keyword.
33 'sdk/tests/compiler/dart2js_native/main.dart': r''' 33 'sdk/tests/compiler/dart2js_native/main.dart': r'''
34 import 'dart:_foreign_helper'; 34 import 'dart:_foreign_helper';
35 import 'dart:_js_helper'; 35 import 'dart:_js_helper';
36 import 'dart:_interceptors';
36 import 'helper.dart'; 37 import 'helper.dart';
37 import 'dart:html'; 38 import 'dart:html';
38 39
39 main() { 40 main() {
40 testEmpty(); 41 testEmpty();
41 testNull(); 42 testNull();
42 testTrue(); 43 testTrue();
43 testFalse(); 44 testFalse();
44 testInt(); 45 testInt();
45 testDouble(); 46 testDouble();
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 testSuperClosurization(); 174 testSuperClosurization();
174 testForwardingConstructor(); 175 testForwardingConstructor();
175 testForwardingConstructorTyped(); 176 testForwardingConstructorTyped();
176 testForwardingConstructorGeneric(); 177 testForwardingConstructorGeneric();
177 testEnum(); 178 testEnum();
178 testStaticGenericMethod(); 179 testStaticGenericMethod();
179 testInstanceGenericMethod(); 180 testInstanceGenericMethod();
180 testDynamicPrivateMethodInvoke(); 181 testDynamicPrivateMethodInvoke();
181 testJSCall(); 182 testJSCall();
182 testNativeMethod(); 183 testNativeMethod();
184 testNativeMethodCreates();
185 testNativeMethodReturns();
183 } 186 }
184 187
185 testEmpty() {} 188 testEmpty() {}
186 testNull() => null; 189 testNull() => null;
187 testTrue() => true; 190 testTrue() => true;
188 testFalse() => false; 191 testFalse() => false;
189 testInt() => 42; 192 testInt() => 42;
190 testDouble() => 37.5; 193 testDouble() => 37.5;
191 testString() => 'foo'; 194 testString() => 'foo';
192 testStringInterpolation() => '${0}'; 195 testStringInterpolation() => '${0}';
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 } 605 }
603 606
604 testInstanceGenericMethod() { 607 testInstanceGenericMethod() {
605 new GenericClass<int, String>.generative().genericMethod<bool>(false); 608 new GenericClass<int, String>.generative().genericMethod<bool>(false);
606 } 609 }
607 610
608 testDynamicPrivateMethodInvoke([o]) => o._privateMethod(); 611 testDynamicPrivateMethodInvoke([o]) => o._privateMethod();
609 testJSCall() => JS('int|bool', '#', null); 612 testJSCall() => JS('int|bool', '#', null);
610 @JSName('foo') 613 @JSName('foo')
611 testNativeMethod() native; 614 testNativeMethod() native;
615 @Creates('int|Null|JSArray')
616 testNativeMethodCreates() native;
617 @Returns('String|Null|JSArray')
618 testNativeMethodReturns() native;
612 ''', 619 ''',
613 'sdk/tests/compiler/dart2js_native/helper.dart': ''' 620 'sdk/tests/compiler/dart2js_native/helper.dart': '''
614 class Class { 621 class Class {
615 const Class.generative(); 622 const Class.generative();
616 factory Class.fact() => null; 623 factory Class.fact() => null;
617 const factory Class.redirect() = Class.generative; 624 const factory Class.redirect() = Class.generative;
618 } 625 }
619 class GenericClass<X, Y> { 626 class GenericClass<X, Y> {
620 const GenericClass.generative(); 627 const GenericClass.generative();
621 factory GenericClass.fact() => null; 628 factory GenericClass.fact() => null;
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 visitList(type.optionalParameterTypes), 877 visitList(type.optionalParameterTypes),
871 type.namedParameters, 878 type.namedParameters,
872 visitList(type.namedParameterTypes)); 879 visitList(type.namedParameterTypes));
873 } 880 }
874 } 881 }
875 882
876 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. 883 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType].
877 ResolutionDartType unalias(ResolutionDartType type) { 884 ResolutionDartType unalias(ResolutionDartType type) {
878 return const Unaliaser().visit(type); 885 return const Unaliaser().visit(type);
879 } 886 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/js_spec_string_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698