Index: tests/compiler/dart2js/list_tracer_test.dart |
diff --git a/tests/compiler/dart2js/list_tracer_test.dart b/tests/compiler/dart2js/list_tracer_test.dart |
index 666c4e06813b8ed9aaaba58f57fbb7eb603aad4c..d54e8e431a34a28978a94917d2b033b50e8ade7c 100644 |
--- a/tests/compiler/dart2js/list_tracer_test.dart |
+++ b/tests/compiler/dart2js/list_tracer_test.dart |
@@ -189,42 +189,43 @@ void main() { |
void doTest(String allocation, {bool nullify}) { |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(generateTest(allocation), uri); |
- compiler.runCompiler(uri); |
- var typesInferrer = compiler.typesTask.typesInferrer; |
- |
- checkType(String name, type) { |
- var element = findElement(compiler, name); |
- ContainerTypeMask mask = typesInferrer.internal.typeOf[element]; |
- if (nullify) type = type.nullable(); |
- Expect.equals(type, mask.elementType.simplify(compiler), name); |
- } |
+ compiler.runCompiler(uri).then((_) { |
+ var typesInferrer = compiler.typesTask.typesInferrer; |
+ |
+ checkType(String name, type) { |
+ var element = findElement(compiler, name); |
+ ContainerTypeMask mask = typesInferrer.internal.typeOf[element]; |
+ if (nullify) type = type.nullable(); |
+ Expect.equals(type, mask.elementType.simplify(compiler), name); |
+ } |
- checkType('listInField', typesInferrer.numType); |
- checkType('listPassedToMethod', typesInferrer.numType); |
- checkType('listReturnedFromMethod', typesInferrer.numType); |
- checkType('listUsedWithCascade', typesInferrer.numType); |
- checkType('listUsedInClosure', typesInferrer.numType); |
- checkType('listPassedToSelector', typesInferrer.numType); |
- checkType('listReturnedFromSelector', typesInferrer.numType); |
- checkType('listUsedWithAddAndInsert', typesInferrer.numType); |
- checkType('listUsedWithConstraint', typesInferrer.numType); |
- checkType('listEscapingFromSetter', typesInferrer.numType); |
- checkType('listUsedInLocal', typesInferrer.numType); |
- checkType('listEscapingInSetterValue', typesInferrer.numType); |
- checkType('listEscapingInIndex', typesInferrer.numType); |
- checkType('listEscapingInIndexSet', typesInferrer.intType); |
- checkType('listEscapingTwiceInIndexSet', typesInferrer.numType); |
- checkType('listSetInNonFinalField', typesInferrer.numType); |
- checkType('listWithChangedLength', typesInferrer.intType.nullable()); |
- |
- checkType('listPassedToClosure', typesInferrer.dynamicType); |
- checkType('listReturnedFromClosure', typesInferrer.dynamicType); |
- checkType('listUsedWithNonOkSelector', typesInferrer.dynamicType); |
- checkType('listPassedAsOptionalParameter', typesInferrer.dynamicType); |
- checkType('listPassedAsNamedParameter', typesInferrer.dynamicType); |
- |
- if (!allocation.contains('filled')) { |
- checkType('listUnset', new TypeMask.nonNullEmpty()); |
- checkType('listOnlySetWithConstraint', new TypeMask.nonNullEmpty()); |
- } |
+ checkType('listInField', typesInferrer.numType); |
+ checkType('listPassedToMethod', typesInferrer.numType); |
+ checkType('listReturnedFromMethod', typesInferrer.numType); |
+ checkType('listUsedWithCascade', typesInferrer.numType); |
+ checkType('listUsedInClosure', typesInferrer.numType); |
+ checkType('listPassedToSelector', typesInferrer.numType); |
+ checkType('listReturnedFromSelector', typesInferrer.numType); |
+ checkType('listUsedWithAddAndInsert', typesInferrer.numType); |
+ checkType('listUsedWithConstraint', typesInferrer.numType); |
+ checkType('listEscapingFromSetter', typesInferrer.numType); |
+ checkType('listUsedInLocal', typesInferrer.numType); |
+ checkType('listEscapingInSetterValue', typesInferrer.numType); |
+ checkType('listEscapingInIndex', typesInferrer.numType); |
+ checkType('listEscapingInIndexSet', typesInferrer.intType); |
+ checkType('listEscapingTwiceInIndexSet', typesInferrer.numType); |
+ checkType('listSetInNonFinalField', typesInferrer.numType); |
+ checkType('listWithChangedLength', typesInferrer.intType.nullable()); |
+ |
+ checkType('listPassedToClosure', typesInferrer.dynamicType); |
+ checkType('listReturnedFromClosure', typesInferrer.dynamicType); |
+ checkType('listUsedWithNonOkSelector', typesInferrer.dynamicType); |
+ checkType('listPassedAsOptionalParameter', typesInferrer.dynamicType); |
+ checkType('listPassedAsNamedParameter', typesInferrer.dynamicType); |
+ |
+ if (!allocation.contains('filled')) { |
+ checkType('listUnset', new TypeMask.nonNullEmpty()); |
+ checkType('listOnlySetWithConstraint', new TypeMask.nonNullEmpty()); |
+ } |
+ }); |
} |