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

Side by Side Diff: tests/compiler/dart2js/type_combination_test.dart

Issue 2653203002: Use entities in CommonElements interface. (Closed)
Patch Set: 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/type_checker_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) 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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 new TypeUse.instantiation(compiler.commonElements.functionType)); 761 new TypeUse.instantiation(compiler.commonElements.functionType));
762 impactBuilder 762 impactBuilder
763 .registerTypeUse(new TypeUse.instantiation(patternImplClass.rawType)); 763 .registerTypeUse(new TypeUse.instantiation(patternImplClass.rawType));
764 compiler.enqueuer.resolution.applyImpact(impactBuilder); 764 compiler.enqueuer.resolution.applyImpact(impactBuilder);
765 compiler.closeResolution(); 765 compiler.closeResolution();
766 ClosedWorld closedWorld = 766 ClosedWorld closedWorld =
767 compiler.resolutionWorldBuilder.closedWorldForTesting; 767 compiler.resolutionWorldBuilder.closedWorldForTesting;
768 768
769 // Grab hold of a supertype for String so we can produce potential 769 // Grab hold of a supertype for String so we can produce potential
770 // string types. 770 // string types.
771 patternClass = closedWorld.commonElements.coreLibrary.find('Pattern'); 771 LibraryElement coreLibrary = closedWorld.commonElements.coreLibrary;
772 patternClass = coreLibrary.find('Pattern');
772 773
773 nonPrimitive1 = new TypeMask.nonNullSubtype( 774 nonPrimitive1 = new TypeMask.nonNullSubtype(
774 closedWorld.commonElements.mapClass, closedWorld); 775 closedWorld.commonElements.mapClass, closedWorld);
775 nonPrimitive2 = new TypeMask.nonNullSubtype( 776 nonPrimitive2 = new TypeMask.nonNullSubtype(
776 closedWorld.commonElements.functionClass, closedWorld); 777 closedWorld.commonElements.functionClass, closedWorld);
777 potentialArray = 778 potentialArray =
778 new TypeMask.subtype(closedWorld.commonElements.listClass, closedWorld); 779 new TypeMask.subtype(closedWorld.commonElements.listClass, closedWorld);
779 potentialString = new TypeMask.subtype(patternClass, closedWorld); 780 potentialString = new TypeMask.subtype(patternClass, closedWorld);
780 jsInterceptor = 781 jsInterceptor =
781 new TypeMask.nonNullSubclass(helpers.jsInterceptorClass, closedWorld); 782 new TypeMask.nonNullSubclass(helpers.jsInterceptorClass, closedWorld);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 Expect.notEquals(jsStringOrNull, potentialString, 827 Expect.notEquals(jsStringOrNull, potentialString,
827 "potentialString expected not to be exact JSString"); 828 "potentialString expected not to be exact JSString");
828 Expect.notEquals(jsArrayOrNull, potentialArray, 829 Expect.notEquals(jsArrayOrNull, potentialArray,
829 "potentialArray expected not to be JSArray subclass"); 830 "potentialArray expected not to be JSArray subclass");
830 831
831 testUnion(compiler); 832 testUnion(compiler);
832 testIntersection(compiler); 833 testIntersection(compiler);
833 testRegressions(compiler); 834 testRegressions(compiler);
834 }); 835 });
835 } 836 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/type_checker_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698