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

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

Issue 17413013: Revert "Support runtime check of function types." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/subtype_test.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/type_representation_test.dart
diff --git a/tests/compiler/dart2js/type_representation_test.dart b/tests/compiler/dart2js/type_representation_test.dart
index 280f839f7debf36c55cc7a7398edb15a721f0c7e..132d3a7308becc89af9cbd31c7f0694917bb12f5 100644
--- a/tests/compiler/dart2js/type_representation_test.dart
+++ b/tests/compiler/dart2js/type_representation_test.dart
@@ -10,7 +10,7 @@ import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart';
import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dart'
show Element, ClassElement;
import '../../../sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart'
- show JavaScriptBackend, TypeRepresentationGenerator;
+ show TypeRepresentationGenerator;
void main() {
testTypeRepresentations();
@@ -42,14 +42,6 @@ void testTypeRepresentations() {
Expect.stringEquals(expectedRepresentation, foundRepresentation);
}
- JavaScriptBackend backend = env.compiler.backend;
- String func = backend.namer.functionTypeTag();
- String retvoid = backend.namer.functionTypeVoidReturnTag();
- String ret = backend.namer.functionTypeReturnTypeTag();
- String args = backend.namer.functionTypeRequiredParametersTag();
- String opt = backend.namer.functionTypeOptionalParametersTag();
- String named = backend.namer.functionTypeNamedParametersTag();
-
ClassElement List_ = env.getElement('List');
TypeVariableType List_E = List_.typeVariables.head;
ClassElement Map_ = env.getElement('Map');
@@ -85,7 +77,7 @@ void testTypeRepresentations() {
// List<int>
expect('[$List_rep, $int_rep]', instantiate(List_, [int_]));
// List<Typedef>
- expect('[$List_rep, {$func: true, $retvoid: true}]',
+ expect('[$List_rep, {func: true, retvoid: true}]',
instantiate(List_, [Typedef_]));
// Map<K,V>
@@ -99,46 +91,46 @@ void testTypeRepresentations() {
instantiate(Map_, [int_, String_]));
// void m1() {}
- expect("{$func: true, $retvoid: true}",
+ expect("{func: true, retvoid: true}",
env.getElement('m1').computeType(env.compiler));
// int m2() => 0;
- expect("{$func: true, $ret: $int_rep}",
+ expect("{func: true, ret: $int_rep}",
env.getElement('m2').computeType(env.compiler));
// List<int> m3() => null;
- expect("{$func: true, $ret: [$List_rep, $int_rep]}",
+ expect("{func: true, ret: [$List_rep, $int_rep]}",
env.getElement('m3').computeType(env.compiler));
// m4() {}
- expect("{$func: true}",
+ expect("{func: true}",
env.getElement('m4').computeType(env.compiler));
// m5(int a, String b) {}
- expect("{$func: true, $args: [$int_rep, $String_rep]}",
+ expect("{func: true, args: [$int_rep, $String_rep]}",
env.getElement('m5').computeType(env.compiler));
// m6(int a, [String b]) {}
- expect("{$func: true, $args: [$int_rep], $opt: [$String_rep]}",
+ expect("{func: true, args: [$int_rep], opt: [$String_rep]}",
env.getElement('m6').computeType(env.compiler));
// m7(int a, String b, [List<int> c, d]) {}
- expect("{$func: true, $args: [$int_rep, $String_rep],"
- " $opt: [[$List_rep, $int_rep], null]}",
+ expect("{func: true, args: [$int_rep, $String_rep],"
+ " opt: [[$List_rep, $int_rep], null]}",
env.getElement('m7').computeType(env.compiler));
// m8(int a, {String b}) {}
- expect("{$func: true, $args: [$int_rep], $named: {b: $String_rep}}",
+ expect("{func: true, args: [$int_rep], named: {b: $String_rep}}",
env.getElement('m8').computeType(env.compiler));
// m9(int a, String b, {List<int> c, d}) {}
- expect("{$func: true, $args: [$int_rep, $String_rep],"
- " $named: {c: [$List_rep, $int_rep], d: null}}",
+ expect("{func: true, args: [$int_rep, $String_rep],"
+ " named: {c: [$List_rep, $int_rep], d: null}}",
env.getElement('m9').computeType(env.compiler));
// m10(void f(int a, [b])) {}
- expect("{$func: true, $args:"
- " [{$func: true, $retvoid: true, $args: [$int_rep], $opt: [null]}]}",
+ expect("{func: true, args:"
+ " [{func: true, retvoid: true, args: [$int_rep], opt: [null]}]}",
env.getElement('m10').computeType(env.compiler));
}
« no previous file with comments | « tests/compiler/dart2js/subtype_test.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698