| 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/common.dart'; | 8 import 'package:compiler/src/common.dart'; |
| 9 import 'package:compiler/src/common_elements.dart'; | 9 import 'package:compiler/src/common_elements.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/feature.dart'; | 23 import 'package:compiler/src/universe/feature.dart'; |
| 24 import 'package:compiler/src/universe/use.dart'; | 24 import 'package:compiler/src/universe/use.dart'; |
| 25 import 'package:compiler/src/util/util.dart'; | 25 import 'package:compiler/src/util/util.dart'; |
| 26 import '../equivalence/check_helpers.dart'; | 26 import '../equivalence/check_helpers.dart'; |
| 27 import 'compiler_helper.dart'; | 27 import 'compiler_helper.dart'; |
| 28 import 'test_helpers.dart'; | 28 import 'test_helpers.dart'; |
| 29 | 29 |
| 30 const Map<String, String> SOURCE = const <String, String>{ | 30 const Map<String, String> SOURCE = const <String, String>{ |
| 31 // Pretend this is a dart2js_native test to allow use of 'native' keyword. | 31 // Pretend this is a dart2js_native test to allow use of 'native' keyword. |
| 32 'sdk/tests/compiler/dart2js_native/main.dart': r''' | 32 'sdk/tests/compiler/dart2js_native/main.dart': r''' |
| 33 @JS() | |
| 34 library test; | |
| 35 | |
| 36 import 'dart:_foreign_helper' as foreign show JS; | 33 import 'dart:_foreign_helper' as foreign show JS; |
| 37 import 'dart:_foreign_helper' hide JS; | 34 import 'dart:_foreign_helper' hide JS; |
| 38 import 'dart:_js_helper'; | 35 import 'dart:_js_helper'; |
| 39 import 'dart:_interceptors'; | 36 import 'dart:_interceptors'; |
| 40 import 'dart:_native_typed_data'; | 37 import 'dart:_native_typed_data'; |
| 41 import 'dart:indexed_db'; | 38 import 'dart:indexed_db'; |
| 42 import 'dart:html'; | 39 import 'dart:html'; |
| 43 import 'dart:html_common'; | 40 import 'dart:html_common'; |
| 44 import 'dart:math'; | 41 import 'dart:math'; |
| 45 import 'dart:typed_data'; | 42 import 'dart:typed_data'; |
| 46 import 'dart:web_sql'; | 43 import 'dart:web_sql'; |
| 47 import 'package:js/js.dart'; | |
| 48 import 'helper.dart'; | 44 import 'helper.dart'; |
| 45 import 'jsinterop.dart'; |
| 49 | 46 |
| 50 main() { | 47 main() { |
| 51 testEmpty(); | 48 testEmpty(); |
| 52 testNull(); | 49 testNull(); |
| 53 testTrue(); | 50 testTrue(); |
| 54 testFalse(); | 51 testFalse(); |
| 55 testInt(); | 52 testInt(); |
| 56 testDouble(); | 53 testDouble(); |
| 57 testString(); | 54 testString(); |
| 58 testStringInterpolation(); | 55 testStringInterpolation(); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 @annotation_Creates_SerializedScriptValue | 688 @annotation_Creates_SerializedScriptValue |
| 692 final Object field; | 689 final Object field; |
| 693 | 690 |
| 694 factory NativeClass._() { throw new UnsupportedError("Not supported"); } | 691 factory NativeClass._() { throw new UnsupportedError("Not supported"); } |
| 695 } | 692 } |
| 696 testNativeField(NativeClass c) => c.field; | 693 testNativeField(NativeClass c) => c.field; |
| 697 testMixinInstantiation() => new Sub(); | 694 testMixinInstantiation() => new Sub(); |
| 698 testNamedMixinInstantiation() => new NamedMixin(); | 695 testNamedMixinInstantiation() => new NamedMixin(); |
| 699 testGenericMixinInstantiation() => new GenericSub<int, String>(); | 696 testGenericMixinInstantiation() => new GenericSub<int, String>(); |
| 700 testGenericNamedMixinInstantiation() => new GenericNamedMixin<int, String>(); | 697 testGenericNamedMixinInstantiation() => new GenericNamedMixin<int, String>(); |
| 698 ''', |
| 699 'sdk/tests/compiler/dart2js_native/jsinterop.dart': ''' |
| 700 @JS() |
| 701 library jsinterop; |
| 702 |
| 703 import 'package:js/js.dart'; |
| 701 | 704 |
| 702 @JS() | 705 @JS() |
| 703 external int testJsInteropMethod(); | 706 external int testJsInteropMethod(); |
| 704 | 707 |
| 705 @JS() | 708 @JS() |
| 706 class JsInteropClass { | 709 class JsInteropClass { |
| 710 external JsInteropClass(); |
| 711 |
| 707 @JS() | 712 @JS() |
| 708 external double method(); | 713 external double method(); |
| 709 } | 714 } |
| 710 | 715 |
| 711 testJsInteropClass() => new JsInteropClass().method(); | 716 testJsInteropClass() => new JsInteropClass().method(); |
| 712 ''', | 717 ''', |
| 713 'sdk/tests/compiler/dart2js_native/helper.dart': ''' | 718 'sdk/tests/compiler/dart2js_native/helper.dart': ''' |
| 714 import 'dart:_js_helper'; | 719 import 'dart:_js_helper'; |
| 715 class Class { | 720 class Class { |
| 716 const Class.generative(); | 721 const Class.generative(); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 builder.registerFeature(Feature.THROW_EXPRESSION); | 915 builder.registerFeature(Feature.THROW_EXPRESSION); |
| 911 break; | 916 break; |
| 912 default: | 917 default: |
| 913 builder.registerFeature(feature); | 918 builder.registerFeature(feature); |
| 914 break; | 919 break; |
| 915 } | 920 } |
| 916 } | 921 } |
| 917 impact.nativeData.forEach(builder.registerNativeData); | 922 impact.nativeData.forEach(builder.registerNativeData); |
| 918 return builder; | 923 return builder; |
| 919 } | 924 } |
| OLD | NEW |