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: test/codegen/expect/cascade.js

Issue 1069493002: implement opassign, fix bugs in pre/postfix, introduce a let* helper (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
1 var cascade; 1 var cascade;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 class A extends core.Object { 4 class A extends core.Object {
5 A() { 5 A() {
6 this.x = null; 6 this.x = null;
7 } 7 }
8 } 8 }
9 // Function test_closure_with_mutate: () → void 9 // Function test_closure_with_mutate: () → void
10 function test_closure_with_mutate() { 10 function test_closure_with_mutate() {
11 let a = new A(); 11 let a = new A();
12 a.x = () => { 12 a.x = () => {
13 core.print("hi"); 13 core.print("hi");
14 a = null; 14 a = null;
15 }; 15 };
16 ((_) => { 16 let _ = a;
Leaf 2015/04/08 04:08:34 That's really nice.
Jennifer Messerly 2015/04/08 16:35:46 yeah, there were a few "emergent" cases like this
17 dart.dinvoke(_, 'x'); 17 dart.dinvoke(_, 'x');
18 dart.dinvoke(_, 'x'); 18 dart.dinvoke(_, 'x');
19 })(a);
20 core.print(a); 19 core.print(a);
21 } 20 }
22 // Function test_closure_without_mutate: () → void 21 // Function test_closure_without_mutate: () → void
23 function test_closure_without_mutate() { 22 function test_closure_without_mutate() {
24 let a = new A(); 23 let a = new A();
25 a.x = () => { 24 a.x = () => {
26 core.print(a); 25 core.print(a);
27 }; 26 };
28 dart.dinvoke(a, 'x'); 27 dart.dinvoke(a, 'x');
29 dart.dinvoke(a, 'x'); 28 dart.dinvoke(a, 'x');
30 core.print(a); 29 core.print(a);
31 } 30 }
32 // Function test_mutate_inside_cascade: () → void 31 // Function test_mutate_inside_cascade: () → void
33 function test_mutate_inside_cascade() { 32 function test_mutate_inside_cascade() {
34 let a = null; 33 let a = null;
35 a = ((_) => { 34 let _ = new A();
36 _.x = a = null; 35 _.x = a = null;
37 _.x = a = null; 36 _.x = a = null;
38 return _; 37 a = _;
39 })(new A());
40 core.print(a); 38 core.print(a);
41 } 39 }
42 // Function test_mutate_outside_cascade: () → void 40 // Function test_mutate_outside_cascade: () → void
43 function test_mutate_outside_cascade() { 41 function test_mutate_outside_cascade() {
44 let a = null, b = null; 42 let a = null, b = null;
45 a = new A(); 43 a = new A();
46 dart.dput(a, 'x', b = null); 44 a.x = b = null;
47 dart.dput(a, 'x', b = null); 45 a.x = b = null;
48 a = null; 46 a = null;
49 core.print(a); 47 core.print(a);
50 } 48 }
51 // Function test_VariableDeclaration_single: () → void 49 // Function test_VariableDeclaration_single: () → void
52 function test_VariableDeclaration_single() { 50 function test_VariableDeclaration_single() {
53 let a = new core.List.from([]); 51 let a = new core.List.from([]);
54 dart.dput(a, 'length', 2); 52 a[core.$length] = 2;
55 a.add(42); 53 a[core.$add](42);
56 core.print(a); 54 core.print(a);
57 } 55 }
58 // Function test_VariableDeclaration_last: () → void 56 // Function test_VariableDeclaration_last: () → void
59 function test_VariableDeclaration_last() { 57 function test_VariableDeclaration_last() {
60 let a = 42, b = new core.List.from([]); 58 let a = 42, b = ((_) => {
Jennifer Messerly 2015/04/07 22:00:29 this is the one case that's now worse (multiple va
61 dart.dput(b, 'length', 2); 59 _[core.$length] = 2;
62 b.add(a); 60 _[core.$add](a);
61 return _;
62 })(new core.List.from([]));
63 core.print(b); 63 core.print(b);
64 } 64 }
65 // Function test_VariableDeclaration_first: () → void 65 // Function test_VariableDeclaration_first: () → void
66 function test_VariableDeclaration_first() { 66 function test_VariableDeclaration_first() {
67 let a = ((_) => { 67 let a = ((_) => {
68 _[core.$length] = 2; 68 _[core.$length] = 2;
69 _[core.$add](3); 69 _[core.$add](3);
70 return _; 70 return _;
71 })(new core.List.from([])), b = 2; 71 })(new core.List.from([])), b = 2;
72 core.print(a); 72 core.print(a);
(...skipping 21 matching lines...) Expand all
94 exports.test_closure_without_mutate = test_closure_without_mutate; 94 exports.test_closure_without_mutate = test_closure_without_mutate;
95 exports.test_mutate_inside_cascade = test_mutate_inside_cascade; 95 exports.test_mutate_inside_cascade = test_mutate_inside_cascade;
96 exports.test_mutate_outside_cascade = test_mutate_outside_cascade; 96 exports.test_mutate_outside_cascade = test_mutate_outside_cascade;
97 exports.test_VariableDeclaration_single = test_VariableDeclaration_single; 97 exports.test_VariableDeclaration_single = test_VariableDeclaration_single;
98 exports.test_VariableDeclaration_last = test_VariableDeclaration_last; 98 exports.test_VariableDeclaration_last = test_VariableDeclaration_last;
99 exports.test_VariableDeclaration_first = test_VariableDeclaration_first; 99 exports.test_VariableDeclaration_first = test_VariableDeclaration_first;
100 exports.Base$ = Base$; 100 exports.Base$ = Base$;
101 exports.Base = Base; 101 exports.Base = Base;
102 exports.Foo = Foo; 102 exports.Foo = Foo;
103 })(cascade || (cascade = {})); 103 })(cascade || (cascade = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698