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

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

Issue 2609063002: Further reduce use of Element in codegen. (Closed)
Patch Set: Created 3 years, 11 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
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 'dart:async'; 5 import 'dart:async';
6 import 'package:expect/expect.dart'; 6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:compiler/src/compiler.dart'; 8 import 'package:compiler/src/compiler.dart';
9 import 'package:compiler/src/diagnostics/messages.dart' show MessageKind; 9 import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
10 import 'package:compiler/src/elements/elements.dart'; 10 import 'package:compiler/src/elements/elements.dart';
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 ensure(compiler, "clear", cls.lookupLocalMember, 987 ensure(compiler, "clear", cls.lookupLocalMember,
988 checkHasBody: true, expectIsPatched: true); 988 checkHasBody: true, expectIsPatched: true);
989 989
990 compiler.phase = Compiler.PHASE_DONE_RESOLVING; 990 compiler.phase = Compiler.PHASE_DONE_RESOLVING;
991 991
992 // Check that a method just in the patch class is a target for a 992 // Check that a method just in the patch class is a target for a
993 // typed selector. 993 // typed selector.
994 Selector selector = 994 Selector selector =
995 new Selector.call(const PublicName('method'), CallStructure.NO_ARGS); 995 new Selector.call(const PublicName('method'), CallStructure.NO_ARGS);
996 TypeMask typeMask = new TypeMask.exact(cls, world); 996 TypeMask typeMask = new TypeMask.exact(cls, world);
997 FunctionElement method = cls.implementation.lookupLocalMember('method'); 997 MethodElement method = cls.implementation.lookupLocalMember('method');
998 method.computeType(compiler.resolution); 998 method.computeType(compiler.resolution);
999 Expect.isTrue(selector.applies(method)); 999 Expect.isTrue(selector.applies(method));
1000 Expect.isTrue(typeMask.canHit(method, selector, world)); 1000 Expect.isTrue(typeMask.canHit(method, selector, world));
1001 1001
1002 // Check that the declaration method in the declaration class is a target 1002 // Check that the declaration method in the declaration class is a target
1003 // for a typed selector. 1003 // for a typed selector.
1004 selector = 1004 selector =
1005 new Selector.call(const PublicName('clear'), CallStructure.NO_ARGS); 1005 new Selector.call(const PublicName('clear'), CallStructure.NO_ARGS);
1006 typeMask = new TypeMask.exact(cls, world); 1006 typeMask = new TypeMask.exact(cls, world);
1007 method = cls.lookupLocalMember('clear'); 1007 method = cls.lookupLocalMember('clear');
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 await testPatchNonFunction(); 1173 await testPatchNonFunction();
1174 1174
1175 await testPatchAndSelector(); 1175 await testPatchAndSelector();
1176 1176
1177 await testEffectiveTarget(); 1177 await testEffectiveTarget();
1178 1178
1179 await testAnalyzeAllInjectedMembers(); 1179 await testAnalyzeAllInjectedMembers();
1180 await testTypecheckPatchedMembers(); 1180 await testTypecheckPatchedMembers();
1181 }); 1181 });
1182 } 1182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698