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

Unified Diff: tests/compiler/dart2js/patch_test.dart

Issue 1182913003: Split TypedSelector into Selector and TypeMask. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/gvn_dynamic_field_get_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/patch_test.dart
diff --git a/tests/compiler/dart2js/patch_test.dart b/tests/compiler/dart2js/patch_test.dart
index 167b096fc35e99ebd3167b912f9bfee46b14e9bb..6f5987858fc1d46456b0e068171ce2e9c7008ad5 100644
--- a/tests/compiler/dart2js/patch_test.dart
+++ b/tests/compiler/dart2js/patch_test.dart
@@ -8,6 +8,7 @@ import "package:async_helper/async_helper.dart";
import "package:compiler/src/dart2jslib.dart";
import "package:compiler/src/elements/elements.dart";
import "package:compiler/src/tree/tree.dart";
+import "package:compiler/src/types/types.dart";
import "mock_compiler.dart";
import "mock_libraries.dart";
import 'package:compiler/src/elements/modelx.dart';
@@ -868,28 +869,28 @@ testPatchAndSelector() {
// Check that a method just in the patch class is a target for a
// typed selector.
Selector selector = new Selector.call('method', compiler.coreLibrary, 0);
- TypedSelector typedSelector = new TypedSelector.exact(cls, selector, world);
+ TypeMask typeMask = new TypeMask.exact(cls, world);
FunctionElement method = cls.implementation.lookupLocalMember('method');
- method.computeSignature(compiler);
+ method.computeType(compiler);
Expect.isTrue(selector.applies(method, world));
- Expect.isTrue(typedSelector.applies(method, world));
+ Expect.isTrue(typeMask.canHit(method, selector, world));
// Check that the declaration method in the declaration class is a target
// for a typed selector.
selector = new Selector.call('clear', compiler.coreLibrary, 0);
- typedSelector = new TypedSelector.exact(cls, selector, world);
+ typeMask = new TypeMask.exact(cls, world);
method = cls.lookupLocalMember('clear');
- method.computeSignature(compiler);
+ method.computeType(compiler);
Expect.isTrue(selector.applies(method, world));
- Expect.isTrue(typedSelector.applies(method, world));
+ Expect.isTrue(typeMask.canHit(method, selector, world));
// Check that the declaration method in the declaration class is a target
// for a typed selector on a subclass.
cls = ensure(compiler, "B", compiler.coreLibrary.find);
cls.ensureResolved(compiler);
- typedSelector = new TypedSelector.exact(cls, selector, world);
+ typeMask = new TypeMask.exact(cls, world);
Expect.isTrue(selector.applies(method, world));
- Expect.isTrue(typedSelector.applies(method, world));
+ Expect.isTrue(typeMask.canHit(method, selector, world));
}));
}
@@ -953,16 +954,12 @@ void testEffectiveTarget() {
ClassElement clsA = compiler.coreLibrary.find("A");
ClassElement clsB = compiler.coreLibrary.find("B");
- Selector forwardCall = new Selector.callConstructor("forward",
- compiler.coreLibrary);
- ConstructorElement forward = clsA.lookupConstructor(forwardCall);
+ ConstructorElement forward = clsA.lookupConstructor("forward");
ConstructorElement target = forward.effectiveTarget;
Expect.isTrue(target.isPatch);
Expect.equals("patchTarget", target.name);
- Selector forwardTwoCall = new Selector.callConstructor("forwardTwo",
- compiler.coreLibrary);
- ConstructorElement forwardTwo = clsA.lookupConstructor(forwardTwoCall);
+ ConstructorElement forwardTwo = clsA.lookupConstructor("forwardTwo");
target = forwardTwo.effectiveTarget;
Expect.isFalse(forwardTwo.isErroneous);
Expect.isFalse(target.isPatch);
« no previous file with comments | « tests/compiler/dart2js/gvn_dynamic_field_get_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698