| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 23 import 'package:compiler/src/universe/call_structure.dart'; | 23 import 'package:compiler/src/universe/call_structure.dart'; |
| 24 import 'package:compiler/src/universe/feature.dart'; | 24 import 'package:compiler/src/universe/feature.dart'; |
| 25 import 'package:compiler/src/universe/use.dart'; | 25 import 'package:compiler/src/universe/use.dart'; |
| 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 'main.dart': r''' | 32 'main.dart': r''' |
| 33 import 'dart:_foreign_helper'; |
| 33 import 'helper.dart'; | 34 import 'helper.dart'; |
| 34 import 'dart:html'; | 35 import 'dart:html'; |
| 35 | 36 |
| 36 main() { | 37 main() { |
| 37 testEmpty(); | 38 testEmpty(); |
| 38 testNull(); | 39 testNull(); |
| 39 testTrue(); | 40 testTrue(); |
| 40 testFalse(); | 41 testFalse(); |
| 41 testInt(); | 42 testInt(); |
| 42 testDouble(); | 43 testDouble(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 testSuperFieldSet(); | 169 testSuperFieldSet(); |
| 169 testSuperSetterSet(); | 170 testSuperSetterSet(); |
| 170 testSuperClosurization(); | 171 testSuperClosurization(); |
| 171 testForwardingConstructor(); | 172 testForwardingConstructor(); |
| 172 testForwardingConstructorTyped(); | 173 testForwardingConstructorTyped(); |
| 173 testForwardingConstructorGeneric(); | 174 testForwardingConstructorGeneric(); |
| 174 testEnum(); | 175 testEnum(); |
| 175 testStaticGenericMethod(); | 176 testStaticGenericMethod(); |
| 176 testInstanceGenericMethod(); | 177 testInstanceGenericMethod(); |
| 177 testDynamicPrivateMethodInvoke(); | 178 testDynamicPrivateMethodInvoke(); |
| 179 testJSCall(); |
| 178 } | 180 } |
| 179 | 181 |
| 180 testEmpty() {} | 182 testEmpty() {} |
| 181 testNull() => null; | 183 testNull() => null; |
| 182 testTrue() => true; | 184 testTrue() => true; |
| 183 testFalse() => false; | 185 testFalse() => false; |
| 184 testInt() => 42; | 186 testInt() => 42; |
| 185 testDouble() => 37.5; | 187 testDouble() => 37.5; |
| 186 testString() => 'foo'; | 188 testString() => 'foo'; |
| 187 testStringInterpolation() => '${0}'; | 189 testStringInterpolation() => '${0}'; |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 List<T> staticGenericMethod<T>(T arg) => [arg]; | 596 List<T> staticGenericMethod<T>(T arg) => [arg]; |
| 595 testStaticGenericMethod() { | 597 testStaticGenericMethod() { |
| 596 staticGenericMethod<int>(0); | 598 staticGenericMethod<int>(0); |
| 597 } | 599 } |
| 598 | 600 |
| 599 testInstanceGenericMethod() { | 601 testInstanceGenericMethod() { |
| 600 new GenericClass<int, String>.generative().genericMethod<bool>(false); | 602 new GenericClass<int, String>.generative().genericMethod<bool>(false); |
| 601 } | 603 } |
| 602 | 604 |
| 603 testDynamicPrivateMethodInvoke([o]) => o._privateMethod(); | 605 testDynamicPrivateMethodInvoke([o]) => o._privateMethod(); |
| 606 testJSCall() => JS('int|bool', '#', null); |
| 604 ''', | 607 ''', |
| 605 'helper.dart': ''' | 608 'helper.dart': ''' |
| 606 class Class { | 609 class Class { |
| 607 const Class.generative(); | 610 const Class.generative(); |
| 608 factory Class.fact() => null; | 611 factory Class.fact() => null; |
| 609 const factory Class.redirect() = Class.generative; | 612 const factory Class.redirect() = Class.generative; |
| 610 } | 613 } |
| 611 class GenericClass<X, Y> { | 614 class GenericClass<X, Y> { |
| 612 const GenericClass.generative(); | 615 const GenericClass.generative(); |
| 613 factory GenericClass.fact() => null; | 616 factory GenericClass.fact() => null; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 visitList(type.optionalParameterTypes), | 864 visitList(type.optionalParameterTypes), |
| 862 type.namedParameters, | 865 type.namedParameters, |
| 863 visitList(type.namedParameterTypes)); | 866 visitList(type.namedParameterTypes)); |
| 864 } | 867 } |
| 865 } | 868 } |
| 866 | 869 |
| 867 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. | 870 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. |
| 868 ResolutionDartType unalias(ResolutionDartType type) { | 871 ResolutionDartType unalias(ResolutionDartType type) { |
| 869 return const Unaliaser().visit(type); | 872 return const Unaliaser().visit(type); |
| 870 } | 873 } |
| OLD | NEW |