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

Side by Side Diff: tests/language/async_this_bound_test.dart

Issue 972063003: Make sure to bind a method to its receiver if it is stored in a temporary. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/compiler/dart2js/async_await_js_transform_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart";
7
8 class A {
9 int a = -1;
10
11 @NoInline()
12 foo(ignored, val) {
13 Expect.equals(val, this.a);
14 }
15 }
16
17 testA() async {
18 var a = new A();
19 a.foo(await false, -1);
20 a.a = 0;
21 a.foo(await false, 0);
22 }
23
24 @NoInline()
25 @AssumeDynamic()
26 confuse(x) => x;
27
28 class B {
29 var f;
30 @NoInline()
31 var b = 10;
32 B(this.f);
33
34 bar(x) => b;
35 }
36
37 foo(x) => 499;
38 bar(x) => 42;
39
40 change(x) {
41 x.f = (x) => 99;
42 }
43
44 testB() async {
45 var b = confuse(new B(foo));
46 Expect.equals(99, b.f(await change(b)));
47 var b2 = confuse(new B(bar));
48 Expect.equals(10, b2.f(await (b2.f = b2.bar)));
49 }
50
51 test() async {
52 await testA();
53 await testB();
54 }
55
56 void main() {
57 asyncStart();
58 test().then((_) => asyncEnd());
59 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/async_await_js_transform_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698