Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
index 7fc524781d516a914caceee4409a96f31febae3c..dfb53704fba8a79fbc49a62cce2bf6e77bf6b77e 100644 |
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
@@ -2471,11 +2471,8 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
js.Expression result = pop(); |
for (TypeVariableType typeVariable in cls.typeVariables) { |
use(node.typeInfoCall); |
- // TODO(johnniwinther): Retrieve the type name properly and not through |
- // [toString]. Note: Two cases below [typeVariable] and |
- // [arguments.head]. |
- js.PropertyAccess field = |
- new js.PropertyAccess.field(pop(), typeVariable.toString()); |
+ int index = RuntimeTypeInformation.getTypeVariableIndex(typeVariable); |
+ js.PropertyAccess field = new js.PropertyAccess.indexed(pop(), index); |
js.Expression genericName = new js.LiteralString("'${arguments.head}'"); |
js.Binary eqTest = new js.Binary('===', field, genericName); |
// Also test for 'undefined' in case the object does not have |
@@ -2483,6 +2480,7 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
js.Prefix undefinedTest = new js.Prefix('!', field); |
result = new js.Binary( |
'&&', result, new js.Binary('||', undefinedTest, eqTest)); |
+ arguments = arguments.tail; |
ngeoffray
2012/11/15 08:58:09
Was it not tested before?
karlklose
2012/11/16 13:37:19
It was, but the tests were marked as failing.
|
} |
push(result, node); |
} |