OLD | NEW |
1 dart_library.library('cascade', null, /* Imports */[ | 1 dart_library.library('cascade', null, /* Imports */[ |
2 "dart_runtime/dart", | 2 "dart_runtime/dart", |
3 'dart/core' | 3 'dart/core' |
4 ], /* Lazy imports */[ | 4 ], /* Lazy imports */[ |
5 ], function(exports, dart, core) { | 5 ], function(exports, dart, core) { |
6 'use strict'; | 6 'use strict'; |
7 let dartx = dart.dartx; | 7 let dartx = dart.dartx; |
8 class A extends core.Object { | 8 class A extends core.Object { |
9 A() { | 9 A() { |
10 this.x = null; | 10 this.x = null; |
11 } | 11 } |
12 } | 12 } |
13 function test_closure_with_mutate() { | 13 function test_closure_with_mutate() { |
14 let a = new A(); | 14 let a = new A(); |
15 a.x = dart.fn(() => { | 15 a.x = dart.fn(() => { |
16 core.print("hi"); | 16 dart.dcall(core.print, "hi"); |
17 a = null; | 17 a = null; |
18 }); | 18 }); |
19 let _ = a; | 19 let _ = a; |
20 dart.dcall(_.x); | 20 dart.dcall(_.x); |
21 dart.dcall(_.x); | 21 dart.dcall(_.x); |
22 core.print(a); | 22 dart.dcall(core.print, a); |
23 } | 23 } |
24 dart.fn(test_closure_with_mutate, dart.void, []); | 24 dart.fn(test_closure_with_mutate, dart.void, []); |
25 function test_closure_without_mutate() { | 25 function test_closure_without_mutate() { |
26 let a = new A(); | 26 let a = new A(); |
27 a.x = dart.fn(() => { | 27 a.x = dart.fn(() => { |
28 core.print(a); | 28 dart.dcall(core.print, a); |
29 }); | 29 }); |
30 dart.dcall(a.x); | 30 dart.dcall(a.x); |
31 dart.dcall(a.x); | 31 dart.dcall(a.x); |
32 core.print(a); | 32 dart.dcall(core.print, a); |
33 } | 33 } |
34 dart.fn(test_closure_without_mutate, dart.void, []); | 34 dart.fn(test_closure_without_mutate, dart.void, []); |
35 function test_mutate_inside_cascade() { | 35 function test_mutate_inside_cascade() { |
36 let a = null; | 36 let a = null; |
37 let _ = new A(); | 37 let _ = new A(); |
38 _.x = a = null; | 38 _.x = a = null; |
39 _.x = a = null; | 39 _.x = a = null; |
40 a = _; | 40 a = _; |
41 core.print(a); | 41 dart.dcall(core.print, a); |
42 } | 42 } |
43 dart.fn(test_mutate_inside_cascade, dart.void, []); | 43 dart.fn(test_mutate_inside_cascade, dart.void, []); |
44 function test_mutate_outside_cascade() { | 44 function test_mutate_outside_cascade() { |
45 let a = null, b = null; | 45 let a = null, b = null; |
46 a = new A(); | 46 a = new A(); |
47 a.x = b = null; | 47 a.x = b = null; |
48 a.x = b = null; | 48 a.x = b = null; |
49 a = null; | 49 a = null; |
50 core.print(a); | 50 dart.dcall(core.print, a); |
51 } | 51 } |
52 dart.fn(test_mutate_outside_cascade, dart.void, []); | 52 dart.fn(test_mutate_outside_cascade, dart.void, []); |
53 function test_VariableDeclaration_single() { | 53 function test_VariableDeclaration_single() { |
54 let a = []; | 54 let a = []; |
55 a[dartx.length] = 2; | 55 a[dartx.length] = 2; |
56 a[dartx.add](42); | 56 dart.dcall(a[dartx.add], 42); |
57 core.print(a); | 57 dart.dcall(core.print, a); |
58 } | 58 } |
59 dart.fn(test_VariableDeclaration_single, dart.void, []); | 59 dart.fn(test_VariableDeclaration_single, dart.void, []); |
60 function test_VariableDeclaration_last() { | 60 function test_VariableDeclaration_last() { |
61 let a = 42, b = (() => { | 61 let a = 42, b = (() => { |
62 let _ = []; | 62 let _ = []; |
63 _[dartx.length] = 2; | 63 _[dartx.length] = 2; |
64 _[dartx.add](a); | 64 dart.dcall(_[dartx.add], a); |
65 return _; | 65 return _; |
66 })(); | 66 })(); |
67 core.print(b); | 67 dart.dcall(core.print, b); |
68 } | 68 } |
69 dart.fn(test_VariableDeclaration_last, dart.void, []); | 69 dart.fn(test_VariableDeclaration_last, dart.void, []); |
70 function test_VariableDeclaration_first() { | 70 function test_VariableDeclaration_first() { |
71 let a = (() => { | 71 let a = (() => { |
72 let _ = []; | 72 let _ = []; |
73 _[dartx.length] = 2; | 73 _[dartx.length] = 2; |
74 _[dartx.add](3); | 74 dart.dcall(_[dartx.add], 3); |
75 return _; | 75 return _; |
76 })(), b = 2; | 76 })(), b = 2; |
77 core.print(a); | 77 dart.dcall(core.print, a); |
78 } | 78 } |
79 dart.fn(test_VariableDeclaration_first, dart.void, []); | 79 dart.fn(test_VariableDeclaration_first, dart.void, []); |
80 function test_increment() { | 80 function test_increment() { |
81 let a = new A(); | 81 let a = new A(); |
82 let y = ((() => { | 82 let y = ((() => { |
83 a.x = dart.dsend(a.x, '+', 1); | 83 a.x = dart.dsend(a.x, '+', 1); |
84 a.x = dart.dsend(a.x, '-', 1); | 84 a.x = dart.dsend(a.x, '-', 1); |
85 return a; | 85 return a; |
86 })()); | 86 })()); |
87 } | 87 } |
88 dart.fn(test_increment, dart.void, []); | 88 dart.fn(test_increment, dart.void, []); |
89 let Base$ = dart.generic(function(T) { | 89 let Base$ = dart.generic(function(T) { |
90 class Base extends core.Object { | 90 class Base extends core.Object { |
91 Base() { | 91 Base() { |
92 this.x = dart.list([], T); | 92 this.x = dart.list([], T); |
93 } | 93 } |
94 } | 94 } |
95 return Base; | 95 return Base; |
96 }); | 96 }); |
97 let Base = Base$(); | 97 let Base = Base$(); |
98 class Foo extends Base$(core.int) { | 98 class Foo extends Base$(core.int) { |
99 Foo() { | 99 Foo() { |
100 super.Base(); | 100 super.Base(); |
101 } | 101 } |
102 test_final_field_generic(t) { | 102 test_final_field_generic(t) { |
103 this.x[dartx.add](1); | 103 dart.dcall(this.x[dartx.add], 1); |
104 this.x[dartx.add](2); | 104 dart.dcall(this.x[dartx.add], 2); |
105 this.x[dartx.add](3); | 105 dart.dcall(this.x[dartx.add], 3); |
106 this.x[dartx.add](4); | 106 dart.dcall(this.x[dartx.add], 4); |
107 } | 107 } |
108 } | 108 } |
109 dart.setSignature(Foo, { | 109 dart.setSignature(Foo, { |
110 methods: () => ({test_final_field_generic: [dart.void, [dart.dynamic]]}) | 110 methods: () => ({test_final_field_generic: [dart.void, [dart.dynamic]]}) |
111 }); | 111 }); |
112 // Exports: | 112 // Exports: |
113 exports.A = A; | 113 exports.A = A; |
114 exports.test_closure_with_mutate = test_closure_with_mutate; | 114 exports.test_closure_with_mutate = test_closure_with_mutate; |
115 exports.test_closure_without_mutate = test_closure_without_mutate; | 115 exports.test_closure_without_mutate = test_closure_without_mutate; |
116 exports.test_mutate_inside_cascade = test_mutate_inside_cascade; | 116 exports.test_mutate_inside_cascade = test_mutate_inside_cascade; |
117 exports.test_mutate_outside_cascade = test_mutate_outside_cascade; | 117 exports.test_mutate_outside_cascade = test_mutate_outside_cascade; |
118 exports.test_VariableDeclaration_single = test_VariableDeclaration_single; | 118 exports.test_VariableDeclaration_single = test_VariableDeclaration_single; |
119 exports.test_VariableDeclaration_last = test_VariableDeclaration_last; | 119 exports.test_VariableDeclaration_last = test_VariableDeclaration_last; |
120 exports.test_VariableDeclaration_first = test_VariableDeclaration_first; | 120 exports.test_VariableDeclaration_first = test_VariableDeclaration_first; |
121 exports.test_increment = test_increment; | 121 exports.test_increment = test_increment; |
122 exports.Base$ = Base$; | 122 exports.Base$ = Base$; |
123 exports.Base = Base; | 123 exports.Base = Base; |
124 exports.Foo = Foo; | 124 exports.Foo = Foo; |
125 }); | 125 }); |
OLD | NEW |