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

Unified Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2360773003: More kernel_impact. (Closed)
Patch Set: Updated cf. comments Created 4 years, 3 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 | « pkg/compiler/lib/src/universe/feature.dart ('k') | tests/compiler/dart2js/kernel/visitor_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/kernel/impact_test.dart
diff --git a/tests/compiler/dart2js/kernel/impact_test.dart b/tests/compiler/dart2js/kernel/impact_test.dart
index 230820ffeb0878add32d7e893fbe4d70e907f7a9..2716d53e6bc7430a98b56b80e779ca7a6e0c4f95 100644
--- a/tests/compiler/dart2js/kernel/impact_test.dart
+++ b/tests/compiler/dart2js/kernel/impact_test.dart
@@ -57,15 +57,22 @@ main() {
testIfThenElse();
testTopLevelInvoke();
testTopLevelInvokeTyped();
+ testTopLevelFunctionTyped();
+ testTopLevelFunctionGet();
testTopLevelField();
testTopLevelFieldTyped();
testDynamicInvoke(null);
testDynamicGet(null);
testDynamicSet(null);
+ testLocalWithoutInitializer();
testLocalWithInitializer();
+ testLocalWithInitializerTyped();
testLocalFunction();
+ testLocalFunctionTyped();
testLocalFunctionInvoke();
testLocalFunctionGet();
+ testClosure();
+ testClosureInvoke();
testInvokeIndex(null);
testInvokeIndexSet(null);
testAssert();
@@ -74,6 +81,10 @@ main() {
testFactoryInvokeGeneric();
testFactoryInvokeGenericRaw();
testFactoryInvokeGenericDynamic();
+ testRedirectingFactoryInvoke();
+ testRedirectingFactoryInvokeGeneric();
+ testRedirectingFactoryInvokeGenericRaw();
+ testRedirectingFactoryInvokeGenericDynamic();
}
testEmpty() {}
@@ -147,6 +158,19 @@ testTopLevelInvokeTyped() {
topLevelFunction3Typed(true, b: [13], c: {'14': true});
topLevelFunction3Typed(false, c: {'16': false}, b: [17]);
}
+
+topLevelFunctionTyped1(void a(num b)) {}
+topLevelFunctionTyped2(void a(num b, [String c])) {}
+topLevelFunctionTyped3(void a(num b, {String c, int d})) {}
+topLevelFunctionTyped4(void a(num b, {String d, int c})) {}
+testTopLevelFunctionTyped() {
+ topLevelFunctionTyped1(null);
+ topLevelFunctionTyped2(null);
+ topLevelFunctionTyped3(null);
+ topLevelFunctionTyped4(null);
+}
+testTopLevelFunctionGet() => topLevelFunction1;
+
var topLevelField;
testTopLevelField() => topLevelField;
int topLevelFieldTyped;
@@ -164,12 +188,21 @@ testDynamicInvoke(o) {
}
testDynamicGet(o) => o.foo;
testDynamicSet(o) => o.foo = 42;
+testLocalWithoutInitializer() {
+ var l;
+}
testLocalWithInitializer() {
var l = 42;
}
+testLocalWithInitializerTyped() {
+ int l = 42;
+}
testLocalFunction() {
localFunction() {}
}
+testLocalFunctionTyped() {
+ int localFunction(String a) => 42;
+}
testLocalFunctionInvoke() {
localFunction() {}
localFunction();
@@ -178,6 +211,12 @@ testLocalFunctionGet() {
localFunction() {}
localFunction;
}
+testClosure() {
+ () {};
+}
+testClosureInvoke() {
+ () {} ();
+}
testInvokeIndex(o) => o[42];
testInvokeIndexSet(o) => o[42] = null;
testAssert() {
@@ -198,13 +237,29 @@ testFactoryInvokeGenericRaw() {
testFactoryInvokeGenericDynamic() {
new GenericClass<dynamic, dynamic>.fact();
}
+testRedirectingFactoryInvoke() {
+ new Class.redirect();
+}
+testRedirectingFactoryInvokeGeneric() {
+ new GenericClass<int, String>.redirect();
+}
+testRedirectingFactoryInvokeGenericRaw() {
+ new GenericClass.redirect();
+}
+testRedirectingFactoryInvokeGenericDynamic() {
+ new GenericClass<dynamic, dynamic>.redirect();
+}
''',
'helper.dart': '''
class Class {
+ Class.generative();
factory Class.fact() => null;
+ factory Class.redirect() = Class.generative;
}
class GenericClass<X, Y> {
+ GenericClass.generative();
factory GenericClass.fact() => null;
+ factory GenericClass.redirect() = GenericClass.generative;
}
''',
};
« no previous file with comments | « pkg/compiler/lib/src/universe/feature.dart ('k') | tests/compiler/dart2js/kernel/visitor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698