OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'package:async_helper/async_helper.dart'; | 5 import 'package:async_helper/async_helper.dart'; |
6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
7 import 'package:compiler/src/js_backend/backend_helpers.dart'; | 7 import 'package:compiler/src/js_backend/backend_helpers.dart'; |
8 import 'package:compiler/src/js_backend/js_backend.dart'; | 8 import 'package:compiler/src/js_backend/js_backend.dart'; |
9 import 'package:compiler/src/types/types.dart'; | 9 import 'package:compiler/src/types/types.dart'; |
10 import 'package:compiler/src/world.dart'; | 10 import 'package:compiler/src/world.dart'; |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 MockCompiler compiler = new MockCompiler.internal(); | 733 MockCompiler compiler = new MockCompiler.internal(); |
734 await compiler.init(""" | 734 await compiler.init(""" |
735 class PatternImpl implements Pattern {} | 735 class PatternImpl implements Pattern {} |
736 """); | 736 """); |
737 JavaScriptBackend backend = compiler.backend; | 737 JavaScriptBackend backend = compiler.backend; |
738 BackendHelpers helpers = backend.helpers; | 738 BackendHelpers helpers = backend.helpers; |
739 ClosedWorld world = compiler.openWorld.closeWorld(); | 739 ClosedWorld world = compiler.openWorld.closeWorld(); |
740 helpers.interceptorsLibrary.forEachLocalMember((element) { | 740 helpers.interceptorsLibrary.forEachLocalMember((element) { |
741 if (element.isClass) { | 741 if (element.isClass) { |
742 element.ensureResolved(compiler.resolution); | 742 element.ensureResolved(compiler.resolution); |
743 backend.registerInstantiatedType(element.rawType, | 743 compiler.enqueuer.resolution.registerInstantiatedType(element.rawType); |
744 compiler.enqueuer.resolution, compiler.globalDependencies); | |
745 } | 744 } |
746 }); | 745 }); |
747 ClassElement patternImplClass = compiler.mainApp.find('PatternImpl'); | 746 ClassElement patternImplClass = compiler.mainApp.find('PatternImpl'); |
748 patternImplClass.ensureResolved(compiler.resolution); | 747 patternImplClass.ensureResolved(compiler.resolution); |
749 | 748 |
750 backend.registerInstantiatedType(compiler.coreTypes.mapType(), | 749 compiler.enqueuer.resolution |
751 compiler.enqueuer.resolution, compiler.globalDependencies); | 750 .registerInstantiatedType(compiler.coreTypes.mapType()); |
752 backend.registerInstantiatedType(compiler.coreTypes.functionType, | 751 compiler.enqueuer.resolution |
753 compiler.enqueuer.resolution, compiler.globalDependencies); | 752 .registerInstantiatedType(compiler.coreTypes.functionType); |
754 backend.registerInstantiatedType(patternImplClass.rawType, | 753 compiler.enqueuer.resolution |
755 compiler.enqueuer.resolution, compiler.globalDependencies); | 754 .registerInstantiatedType(patternImplClass.rawType); |
756 compiler.openWorld.closeWorld(); | 755 compiler.openWorld.closeWorld(); |
757 | 756 |
758 // Grab hold of a supertype for String so we can produce potential | 757 // Grab hold of a supertype for String so we can produce potential |
759 // string types. | 758 // string types. |
760 patternClass = compiler.commonElements.coreLibrary.find('Pattern'); | 759 patternClass = compiler.commonElements.coreLibrary.find('Pattern'); |
761 | 760 |
762 nonPrimitive1 = | 761 nonPrimitive1 = |
763 new TypeMask.nonNullSubtype(compiler.coreClasses.mapClass, world); | 762 new TypeMask.nonNullSubtype(compiler.coreClasses.mapClass, world); |
764 nonPrimitive2 = | 763 nonPrimitive2 = |
765 new TypeMask.nonNullSubtype(compiler.coreClasses.functionClass, world); | 764 new TypeMask.nonNullSubtype(compiler.coreClasses.functionClass, world); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 Expect.notEquals(jsStringOrNull, potentialString, | 809 Expect.notEquals(jsStringOrNull, potentialString, |
811 "potentialString expected not to be exact JSString"); | 810 "potentialString expected not to be exact JSString"); |
812 Expect.notEquals(jsArrayOrNull, potentialArray, | 811 Expect.notEquals(jsArrayOrNull, potentialArray, |
813 "potentialArray expected not to be JSArray subclass"); | 812 "potentialArray expected not to be JSArray subclass"); |
814 | 813 |
815 testUnion(compiler); | 814 testUnion(compiler); |
816 testIntersection(compiler); | 815 testIntersection(compiler); |
817 testRegressions(compiler); | 816 testRegressions(compiler); |
818 }); | 817 }); |
819 } | 818 } |
OLD | NEW |