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

Unified Diff: test/codegen/language/async_this_bound_test.dart

Issue 1243503007: fixes #221, initial sync*, async, async* implementation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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 | « test/codegen/language/async_test.dart ('k') | test/codegen/language/async_throw_in_catch_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/language/async_this_bound_test.dart
diff --git a/test/codegen/language/async_this_bound_test.dart b/test/codegen/language/async_this_bound_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8757f039d37114a07533da99db3b0afb7efb430f
--- /dev/null
+++ b/test/codegen/language/async_this_bound_test.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import "package:async_helper/async_helper.dart";
+
+class A {
+ int a = -1;
+
+ @NoInline()
+ foo(ignored, val) {
+ Expect.equals(val, this.a);
+ }
+}
+
+testA() async {
+ var a = new A();
+ a.foo(await false, -1);
+ a.a = 0;
+ a.foo(await false, 0);
+}
+
+@NoInline()
+@AssumeDynamic()
+confuse(x) => x;
+
+class B {
+ var f;
+ @NoInline()
+ var b = 10;
+ B(this.f);
+
+ bar(x) => b;
+}
+
+foo(x) => 499;
+bar(x) => 42;
+
+change(x) {
+ x.f = (x) => 99;
+}
+
+testB() async {
+ var b = confuse(new B(foo));
+ Expect.equals(99, b.f(await change(b)));
+ var b2 = confuse(new B(bar));
+ Expect.equals(10, b2.f(await (b2.f = b2.bar)));
+}
+
+test() async {
+ await testA();
+ await testB();
+}
+
+void main() {
+ asyncStart();
+ test().then((_) => asyncEnd());
+}
« no previous file with comments | « test/codegen/language/async_test.dart ('k') | test/codegen/language/async_throw_in_catch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698