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

Side by Side Diff: test/codegen/expect/cascade/cascade.js

Issue 949383003: use js_ast instead of strings to generate JS (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: add redirecting ctor test Created 5 years, 10 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 | « test/codegen/expect/async/async.js ('k') | test/codegen/expect/collection/collection.js » ('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 (cascade) { 2 (function(cascade) {
3 'use strict'; 3 'use strict';
4 class A extends dart.Object { 4 class A extends dart.Object {
5 A() { 5 A() {
6 this.x = null; 6 this.x = null;
7 } 7 }
8 } 8 }
9
10 // Function test_closure_with_mutate: () → void 9 // Function test_closure_with_mutate: () → void
11 function test_closure_with_mutate() { 10 function test_closure_with_mutate() {
12 let a = new A(); 11 let a = new A();
13 a.x = () => { 12 a.x = () => {
14 core.print("hi"); 13 core.print("hi");
15 a = null; 14 a = null;
16 }; 15 };
17 ((_) => { 16 ((_) => {
18 dart.dinvoke(_, "x"); 17 dart.dinvoke(_, 'x');
19 dart.dinvoke(_, "x"); 18 dart.dinvoke(_, 'x');
20 })(a); 19 })(a);
21 core.print(a); 20 core.print(a);
22 } 21 }
23
24 // Function test_closure_without_mutate: () → void 22 // Function test_closure_without_mutate: () → void
25 function test_closure_without_mutate() { 23 function test_closure_without_mutate() {
26 let a = new A(); 24 let a = new A();
27 a.x = () => { 25 a.x = () => {
28 core.print(a); 26 core.print(a);
29 }; 27 };
30 dart.dinvoke(a, "x"); 28 dart.dinvoke(a, 'x');
31 dart.dinvoke(a, "x"); 29 dart.dinvoke(a, 'x');
32 core.print(a); 30 core.print(a);
33 } 31 }
34
35 // Function test_mutate_inside_cascade: () → void 32 // Function test_mutate_inside_cascade: () → void
36 function test_mutate_inside_cascade() { 33 function test_mutate_inside_cascade() {
37 let a = null; 34 let a = null;
38 a = ((_) => { 35 a = ((_) => {
39 _.x = (a = null); 36 _.x = a = null;
40 _.x = (a = null); 37 _.x = a = null;
41 return _; 38 return _;
42 })(new A()); 39 })(new A());
43 core.print(a); 40 core.print(a);
44 } 41 }
45
46 // Function test_mutate_outside_cascade: () → void 42 // Function test_mutate_outside_cascade: () → void
47 function test_mutate_outside_cascade() { 43 function test_mutate_outside_cascade() {
48 let a = null, b = null; 44 let a = null, b = null;
49 a = new A(); 45 a = new A();
50 dart.dput(a, "x", (b = null)); 46 dart.dput(a, 'x', b = null);
51 dart.dput(a, "x", (b = null)); 47 dart.dput(a, 'x', b = null);
52 a = null; 48 a = null;
53 core.print(a); 49 core.print(a);
54 } 50 }
55
56 // Function test_VariableDeclaration_single: () → void 51 // Function test_VariableDeclaration_single: () → void
57 function test_VariableDeclaration_single() { 52 function test_VariableDeclaration_single() {
58 let a = new List.from([]); 53 let a = new List.from([]);
59 dart.dput(a, "length", 2); 54 dart.dput(a, 'length', 2);
60 a.add(42); 55 a.add(42);
61 core.print(a); 56 core.print(a);
62 } 57 }
63
64 // Function test_VariableDeclaration_last: () → void 58 // Function test_VariableDeclaration_last: () → void
65 function test_VariableDeclaration_last() { 59 function test_VariableDeclaration_last() {
66 let a = 42, b = new List.from([]); 60 let a = 42, b = new List.from([]);
67 dart.dput(b, "length", 2); 61 dart.dput(b, 'length', 2);
68 b.add(a); 62 b.add(a);
69 core.print(b); 63 core.print(b);
70 } 64 }
71
72 // Function test_VariableDeclaration_first: () → void 65 // Function test_VariableDeclaration_first: () → void
73 function test_VariableDeclaration_first() { 66 function test_VariableDeclaration_first() {
74 let a = ((_) => { 67 let a = ((_) => {
75 _.length = 2; 68 _.length = 2;
76 _.add(3); 69 _.add(3);
77 return _; 70 return _;
78 })(new List.from([])), b = 2; 71 })(new List.from([])), b = 2;
79 core.print(a); 72 core.print(a);
80 } 73 }
81
82 // Exports: 74 // Exports:
83 cascade.A = A; 75 cascade.A = A;
84 cascade.test_closure_with_mutate = test_closure_with_mutate; 76 cascade.test_closure_with_mutate = test_closure_with_mutate;
85 cascade.test_closure_without_mutate = test_closure_without_mutate; 77 cascade.test_closure_without_mutate = test_closure_without_mutate;
86 cascade.test_mutate_inside_cascade = test_mutate_inside_cascade; 78 cascade.test_mutate_inside_cascade = test_mutate_inside_cascade;
87 cascade.test_mutate_outside_cascade = test_mutate_outside_cascade; 79 cascade.test_mutate_outside_cascade = test_mutate_outside_cascade;
88 cascade.test_VariableDeclaration_single = test_VariableDeclaration_single; 80 cascade.test_VariableDeclaration_single = test_VariableDeclaration_single;
89 cascade.test_VariableDeclaration_last = test_VariableDeclaration_last; 81 cascade.test_VariableDeclaration_last = test_VariableDeclaration_last;
90 cascade.test_VariableDeclaration_first = test_VariableDeclaration_first; 82 cascade.test_VariableDeclaration_first = test_VariableDeclaration_first;
91 })(cascade || (cascade = {})); 83 })(cascade || (cascade = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/async/async.js ('k') | test/codegen/expect/collection/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698