OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Test that poi.dart can serialize a scope. | 5 /// Test that poi.dart can serialize a scope. |
6 | 6 |
7 library trydart.serialize_test; | 7 library trydart.serialize_test; |
8 | 8 |
9 import 'dart:io' show | 9 import 'dart:io' show |
10 Platform; | 10 Platform; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void main() { | 67 void main() { |
68 asyncTest(testInteresting); | 68 asyncTest(testInteresting); |
69 } | 69 } |
70 | 70 |
71 final expectedInteresting = { | 71 final expectedInteresting = { |
72 "name": "fisk", | 72 "name": "fisk", |
73 "kind": "function", | 73 "kind": "function", |
74 "type": "() -> dynamic", | 74 "type": "() -> dynamic", |
75 "enclosing": { | 75 "enclosing": { |
76 "name": "Foo", | 76 "name": "Foo", |
77 "kind": "class", | 77 "kind": "class side", |
78 "members": [ | 78 "members": [ |
| 79 { |
| 80 "kind": "generative_constructor", |
| 81 "type": "() -> Foo" |
| 82 } |
79 ], | 83 ], |
80 "enclosing": { | 84 "enclosing": { |
81 "name": "this(Foo)", | 85 "name": "Foo", |
82 "kind": "class", | 86 "kind": "instance side", |
83 "members": [ | 87 "members": [ |
84 { | 88 { |
85 "name": "fisk", | 89 "name": "fisk", |
86 "kind": "function", | 90 "kind": "function", |
87 "type": "() -> dynamic" | 91 "type": "() -> dynamic" |
88 }, | 92 }, |
89 { | 93 { |
90 "name": "hest", | 94 "name": "hest", |
91 "kind": "function", | 95 "kind": "function", |
92 "type": "() -> dynamic" | 96 "type": "() -> dynamic" |
93 }, | 97 }, |
94 { | |
95 "kind": "generative_constructor", | |
96 "type": "() -> Foo" | |
97 } | |
98 ], | 98 ], |
99 "enclosing": { | 99 "enclosing": { |
100 "name": "interesting", | 100 "name": "interesting", |
101 "kind": "library", | 101 "kind": "library", |
102 "members": [ | 102 "members": [ |
103 { | 103 { |
104 "name": "Foo", | 104 "name": "Foo", |
105 "kind": "class" | 105 "kind": "class" |
106 }, | 106 }, |
107 { | 107 { |
(...skipping 11 matching lines...) Expand all Loading... |
119 } | 119 } |
120 } | 120 } |
121 }; | 121 }; |
122 | 122 |
123 final expectedSubclass = { | 123 final expectedSubclass = { |
124 "name": "instanceMethod2", | 124 "name": "instanceMethod2", |
125 "kind": "function", | 125 "kind": "function", |
126 "type": "() -> dynamic", | 126 "type": "() -> dynamic", |
127 "enclosing": { | 127 "enclosing": { |
128 "name": "C", | 128 "name": "C", |
129 "kind": "class", | 129 "kind": "class side", |
130 "members": [ | 130 "members": [ |
131 { | 131 { |
132 "name": "staticMethod1", | 132 "name": "staticMethod1", |
133 "kind": "function", | 133 "kind": "function", |
134 "type": "() -> dynamic" | 134 "type": "() -> dynamic" |
135 }, | 135 }, |
136 { | 136 { |
137 "name": "staticMethod2", | 137 "name": "staticMethod2", |
138 "kind": "function", | 138 "kind": "function", |
139 "type": "() -> dynamic" | 139 "type": "() -> dynamic" |
| 140 }, |
| 141 { |
| 142 "kind": "generative_constructor", |
| 143 "type": "() -> C" |
140 } | 144 } |
141 ], | 145 ], |
142 "enclosing": { | 146 "enclosing": { |
143 "name": "this(C)", | 147 "name": "C", |
144 "kind": "class", | 148 "kind": "instance side", |
145 "members": [ | 149 "members": [ |
146 { | 150 { |
147 "name": "instanceMethod1", | 151 "name": "instanceMethod1", |
148 "kind": "function", | 152 "kind": "function", |
149 "type": "() -> dynamic" | 153 "type": "() -> dynamic" |
150 }, | 154 }, |
151 { | 155 { |
152 "name": "instanceMethod2", | 156 "name": "instanceMethod2", |
153 "kind": "function", | 157 "kind": "function", |
154 "type": "() -> dynamic" | 158 "type": "() -> dynamic" |
155 }, | |
156 { | |
157 "kind": "generative_constructor", | |
158 "type": "() -> C" | |
159 } | 159 } |
160 ], | 160 ], |
161 "enclosing": { | 161 "enclosing": { |
162 "name": "subclass", | 162 "name": "subclass", |
163 "kind": "library", | 163 "kind": "library", |
164 "members": [ | 164 "members": [ |
165 { | 165 { |
166 "name": "S", | 166 "name": "S", |
167 "kind": "class" | 167 "kind": "class" |
168 }, | 168 }, |
(...skipping 18 matching lines...) Expand all Loading... |
187 "name": "Foo", | 187 "name": "Foo", |
188 "kind": "class" | 188 "kind": "class" |
189 }, | 189 }, |
190 { | 190 { |
191 "name": "main", | 191 "name": "main", |
192 "kind": "function", | 192 "kind": "function", |
193 "type": "() -> dynamic" | 193 "type": "() -> dynamic" |
194 }, | 194 }, |
195 ]..addAll(coreImports), | 195 ]..addAll(coreImports), |
196 "enclosing": { | 196 "enclosing": { |
197 "name": "this(S)", | 197 "name": "S", |
198 "kind": "class", | 198 "kind": "instance side", |
199 "members": [ | 199 "members": [ |
200 { | 200 { |
201 "name": "superMethod1", | 201 "name": "superMethod1", |
202 "kind": "function", | 202 "kind": "function", |
203 "type": "() -> dynamic" | 203 "type": "() -> dynamic" |
204 }, | 204 }, |
205 { | 205 { |
206 "name": "superMethod2", | 206 "name": "superMethod2", |
207 "kind": "function", | 207 "kind": "function", |
208 "type": "() -> dynamic" | 208 "type": "() -> dynamic" |
209 }, | 209 }, |
210 { | |
211 "kind": "generative_constructor", | |
212 "type": "() -> S" | |
213 } | |
214 ], | 210 ], |
215 "enclosing": { | 211 "enclosing": { |
216 "name": "this(P)", | 212 "name": "P", |
217 "kind": "class", | 213 "kind": "instance side", |
218 "members": [ | 214 "members": [ |
219 { | 215 { |
220 "name": "pMethod1", | 216 "name": "pMethod1", |
221 "kind": "function", | 217 "kind": "function", |
222 "type": "() -> dynamic" | 218 "type": "() -> dynamic" |
223 }, | 219 }, |
224 { | 220 { |
225 "name": "pMethod2", | 221 "name": "pMethod2", |
226 "kind": "function", | 222 "kind": "function", |
227 "type": "() -> dynamic" | 223 "type": "() -> dynamic" |
228 }, | 224 }, |
229 { | 225 { |
230 "name": "_pMethod1", | 226 "name": "_pMethod1", |
231 "kind": "function", | 227 "kind": "function", |
232 "type": "() -> dynamic" | 228 "type": "() -> dynamic" |
233 }, | 229 }, |
234 { | 230 { |
235 "name": "_pMethod2", | 231 "name": "_pMethod2", |
236 "kind": "function", | 232 "kind": "function", |
237 "type": "() -> dynamic" | 233 "type": "() -> dynamic" |
238 }, | 234 }, |
239 { | |
240 "kind": "generative_constructor", | |
241 "type": "() -> P" | |
242 } | |
243 ], | 235 ], |
244 "enclosing": object, | 236 "enclosing": object, |
245 } | 237 } |
246 } | 238 } |
247 } | 239 } |
248 } | 240 } |
249 } | 241 } |
250 } | 242 } |
251 }; | 243 }; |
252 | 244 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 "name": "Type", | 485 "name": "Type", |
494 "kind": "class" | 486 "kind": "class" |
495 }, | 487 }, |
496 { | 488 { |
497 "name": "Uri", | 489 "name": "Uri", |
498 "kind": "class" | 490 "kind": "class" |
499 } | 491 } |
500 ]; | 492 ]; |
501 | 493 |
502 final object = { | 494 final object = { |
503 "name": "this(Object)", | 495 "name": "Object", |
504 "kind": "class", | 496 "kind": "instance side", |
505 "members": [ | 497 "members": [ |
506 { | 498 { |
507 "kind": "generative_constructor", | |
508 "type": "() -> dynamic" | |
509 }, | |
510 { | |
511 "name": "==", | 499 "name": "==", |
512 "kind": "function", | 500 "kind": "function", |
513 "type": "(dynamic) -> bool" | 501 "type": "(dynamic) -> bool" |
514 }, | 502 }, |
515 { | 503 { |
516 "name": "hashCode", | 504 "name": "hashCode", |
517 "kind": "getter" | 505 "kind": "getter" |
518 }, | 506 }, |
519 { | 507 { |
520 "name": "toString", | 508 "name": "toString", |
521 "kind": "function", | 509 "kind": "function", |
522 "type": "() -> String" | 510 "type": "() -> String" |
523 }, | 511 }, |
524 { | 512 { |
525 "name": "noSuchMethod", | 513 "name": "noSuchMethod", |
526 "kind": "function", | 514 "kind": "function", |
527 "type": "(Invocation) -> dynamic" | 515 "type": "(Invocation) -> dynamic" |
528 }, | 516 }, |
529 { | 517 { |
530 "name": "runtimeType", | 518 "name": "runtimeType", |
531 "kind": "getter" | 519 "kind": "getter" |
532 } | 520 } |
533 ] | 521 ] |
534 }; | 522 }; |
OLD | NEW |