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

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

Issue 17759007: First pass at asynchronous input loading in dart2js. (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
Index: tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
diff --git a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
index cfae3a72e89cbf8af8bfe06089c2395e1d71b518..d6bff7cb99c050465f05ed873fecb0b8aaabdb1f 100644
--- a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
@@ -13,7 +13,7 @@ class A {
set foo(value) {}
operator[](index) => 'string';
operator[]=(index, value) {}
-
+
returnDynamic1() => foo--;
returnNum1() => --foo;
returnNum2() => foo -= 42;
@@ -63,33 +63,34 @@ main() {
void main() {
Uri uri = new Uri(scheme: 'source');
var compiler = compilerFor(TEST, uri);
- compiler.runCompiler(uri);
- var typesInferrer = compiler.typesTask.typesInferrer;
-
- checkReturnInClass(String className, String methodName, type) {
- var cls = findElement(compiler, className);
- var element = cls.lookupLocalMember(buildSourceString(methodName));
- Expect.equals(type,
- typesInferrer.internal.returnTypeOf[element].simplify(compiler));
- }
-
- var subclassOfInterceptor =
- findTypeMask(compiler, 'Interceptor', 'nonNullSubclass');
-
- checkReturnInClass('A', 'returnNum1', typesInferrer.numType);
- checkReturnInClass('A', 'returnNum2', typesInferrer.numType);
- checkReturnInClass('A', 'returnNum3', typesInferrer.numType);
- checkReturnInClass('A', 'returnNum4', typesInferrer.numType);
- checkReturnInClass('A', 'returnNum5', typesInferrer.numType);
- checkReturnInClass('A', 'returnNum6', typesInferrer.numType);
- checkReturnInClass('A', 'returnDynamic1', subclassOfInterceptor);
- checkReturnInClass('A', 'returnDynamic2', subclassOfInterceptor);
- checkReturnInClass('A', 'returnDynamic3', typesInferrer.dynamicType);
-
- checkReturnInClass('B', 'returnString1', typesInferrer.stringType);
- checkReturnInClass('B', 'returnString2', typesInferrer.stringType);
- checkReturnInClass('B', 'returnDynamic1', typesInferrer.dynamicType);
- checkReturnInClass('B', 'returnDynamic2', typesInferrer.dynamicType);
- checkReturnInClass('B', 'returnDynamic3', typesInferrer.dynamicType);
- checkReturnInClass('B', 'returnDynamic4', typesInferrer.dynamicType);
+ compiler.runCompiler(uri).then((_) {
+ var typesInferrer = compiler.typesTask.typesInferrer;
+
+ checkReturnInClass(String className, String methodName, type) {
+ var cls = findElement(compiler, className);
+ var element = cls.lookupLocalMember(buildSourceString(methodName));
+ Expect.equals(type,
+ typesInferrer.internal.returnTypeOf[element].simplify(compiler));
+ }
+
+ var subclassOfInterceptor =
+ findTypeMask(compiler, 'Interceptor', 'nonNullSubclass');
+
+ checkReturnInClass('A', 'returnNum1', typesInferrer.numType);
+ checkReturnInClass('A', 'returnNum2', typesInferrer.numType);
+ checkReturnInClass('A', 'returnNum3', typesInferrer.numType);
+ checkReturnInClass('A', 'returnNum4', typesInferrer.numType);
+ checkReturnInClass('A', 'returnNum5', typesInferrer.numType);
+ checkReturnInClass('A', 'returnNum6', typesInferrer.numType);
+ checkReturnInClass('A', 'returnDynamic1', subclassOfInterceptor);
+ checkReturnInClass('A', 'returnDynamic2', subclassOfInterceptor);
+ checkReturnInClass('A', 'returnDynamic3', typesInferrer.dynamicType);
+
+ checkReturnInClass('B', 'returnString1', typesInferrer.stringType);
+ checkReturnInClass('B', 'returnString2', typesInferrer.stringType);
+ checkReturnInClass('B', 'returnDynamic1', typesInferrer.dynamicType);
+ checkReturnInClass('B', 'returnDynamic2', typesInferrer.dynamicType);
+ checkReturnInClass('B', 'returnDynamic3', typesInferrer.dynamicType);
+ checkReturnInClass('B', 'returnDynamic4', typesInferrer.dynamicType);
+ });
}

Powered by Google App Engine
This is Rietveld 408576698