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

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
« no previous file with comments | « lib/src/js/template.dart ('k') | test/codegen/expect/map_keys.js.map » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
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 = (() => {
61 dart.dput(b, 'length', 2); 59 let _ = new core.List.from([]);
62 b.add(a); 60 _[core.$length] = 2;
61 _[core.$add](a);
62 return _;
63 })();
63 core.print(b); 64 core.print(b);
64 } 65 }
65 // Function test_VariableDeclaration_first: () → void 66 // Function test_VariableDeclaration_first: () → void
66 function test_VariableDeclaration_first() { 67 function test_VariableDeclaration_first() {
67 let a = ((_) => { 68 let a = (() => {
69 let _ = new core.List.from([]);
68 _[core.$length] = 2; 70 _[core.$length] = 2;
69 _[core.$add](3); 71 _[core.$add](3);
70 return _; 72 return _;
71 })(new core.List.from([])), b = 2; 73 })(), b = 2;
72 core.print(a); 74 core.print(a);
73 } 75 }
74 let Base$ = dart.generic(function(T) { 76 let Base$ = dart.generic(function(T) {
75 class Base extends core.Object { 77 class Base extends core.Object {
76 Base() { 78 Base() {
77 this.x = new core.List$(T).from([]); 79 this.x = new core.List$(T).from([]);
78 } 80 }
79 } 81 }
80 return Base; 82 return Base;
81 }); 83 });
(...skipping 12 matching lines...) Expand all
94 exports.test_closure_without_mutate = test_closure_without_mutate; 96 exports.test_closure_without_mutate = test_closure_without_mutate;
95 exports.test_mutate_inside_cascade = test_mutate_inside_cascade; 97 exports.test_mutate_inside_cascade = test_mutate_inside_cascade;
96 exports.test_mutate_outside_cascade = test_mutate_outside_cascade; 98 exports.test_mutate_outside_cascade = test_mutate_outside_cascade;
97 exports.test_VariableDeclaration_single = test_VariableDeclaration_single; 99 exports.test_VariableDeclaration_single = test_VariableDeclaration_single;
98 exports.test_VariableDeclaration_last = test_VariableDeclaration_last; 100 exports.test_VariableDeclaration_last = test_VariableDeclaration_last;
99 exports.test_VariableDeclaration_first = test_VariableDeclaration_first; 101 exports.test_VariableDeclaration_first = test_VariableDeclaration_first;
100 exports.Base$ = Base$; 102 exports.Base$ = Base$;
101 exports.Base = Base; 103 exports.Base = Base;
102 exports.Foo = Foo; 104 exports.Foo = Foo;
103 })(cascade || (cascade = {})); 105 })(cascade || (cascade = {}));
OLDNEW
« no previous file with comments | « lib/src/js/template.dart ('k') | test/codegen/expect/map_keys.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698