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