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 132d3a7308becc89af9cbd31c7f0694917bb12f5..280f839f7debf36c55cc7a7398edb15a721f0c7e 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 TypeRepresentationGenerator; |
+ show JavaScriptBackend, TypeRepresentationGenerator; |
void main() { |
testTypeRepresentations(); |
@@ -42,6 +42,14 @@ 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'); |
@@ -77,7 +85,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> |
@@ -91,46 +99,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)); |
} |