OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library instance_view_element; | 5 library instance_view_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/src/elements/class_ref.dart'; | 10 import 'package:observatory/src/elements/class_ref.dart'; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 void render() { | 158 void render() { |
159 final content = [ | 159 final content = [ |
160 new HeadingElement.h2()..text = M.isAbstractType(_instance.kind) | 160 new HeadingElement.h2()..text = M.isAbstractType(_instance.kind) |
161 ? 'type ${_instance.name}' | 161 ? 'type ${_instance.name}' |
162 : 'instance of ${_instance.clazz.name}', | 162 : 'instance of ${_instance.clazz.name}', |
163 new HRElement(), | 163 new HRElement(), |
164 new ObjectCommonElement(_isolate, _instance, _retainedSizes, | 164 new ObjectCommonElement(_isolate, _instance, _retainedSizes, |
165 _reachableSizes, _references, _retainingPaths, | 165 _reachableSizes, _references, _retainingPaths, |
166 _instances, queue: _r.queue), | 166 _instances, queue: _r.queue), |
167 new BRElement(), | 167 new BRElement(), |
168 new DivElement()..classes = const ['memberList'] | 168 new DivElement()..classes = ['memberList'] |
169 ..children = _createMembers(), | 169 ..children = _createMembers(), |
170 new HRElement(), | 170 new HRElement(), |
171 new EvalBoxElement(_isolate, _instance, _instances, _eval, | 171 new EvalBoxElement(_isolate, _instance, _instances, _eval, |
172 quickExpressions: const ['toString()', | 172 quickExpressions: const ['toString()', |
173 'runtimeType'], | 173 'runtimeType'], |
174 queue: _r.queue) | 174 queue: _r.queue) |
175 ]; | 175 ]; |
176 if (_location != null) { | 176 if (_location != null) { |
177 content.addAll([ | 177 content.addAll([ |
178 new HRElement(), | 178 new HRElement(), |
179 new SourceInsetElement(_isolate, _location, _scripts, _instances, | 179 new SourceInsetElement(_isolate, _location, _scripts, _instances, |
180 _events, queue: _r.queue) | 180 _events, queue: _r.queue) |
181 ]); | 181 ]); |
182 } | 182 } |
183 content.addAll([ | 183 content.addAll([ |
184 new HRElement(), | 184 new HRElement(), |
185 new ViewFooterElement(queue: _r.queue) | 185 new ViewFooterElement(queue: _r.queue) |
186 ]); | 186 ]); |
187 children = [ | 187 children = [ |
188 new NavBarElement(queue: _r.queue) | 188 new NavBarElement(queue: _r.queue) |
189 ..children = _createMenu(), | 189 ..children = _createMenu(), |
190 new DivElement()..classes = const ['content-centered-big'] | 190 new DivElement()..classes = ['content-centered-big'] |
191 ..children = content | 191 ..children = content |
192 ]; | 192 ]; |
193 } | 193 } |
194 | 194 |
195 List<Element> _createMenu() { | 195 List<Element> _createMenu() { |
196 final menu = [ | 196 final menu = [ |
197 new NavTopMenuElement(queue: _r.queue), | 197 new NavTopMenuElement(queue: _r.queue), |
198 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 198 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
199 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue) | 199 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue) |
200 ]; | 200 ]; |
(...skipping 10 matching lines...) Expand all Loading... |
211 _refresh(); | 211 _refresh(); |
212 }), | 212 }), |
213 new NavNotifyElement(_notifications, queue: _r.queue) | 213 new NavNotifyElement(_notifications, queue: _r.queue) |
214 ]); | 214 ]); |
215 return menu; | 215 return menu; |
216 } | 216 } |
217 | 217 |
218 List<Element> _createMembers() { | 218 List<Element> _createMembers() { |
219 final members = <Element>[]; | 219 final members = <Element>[]; |
220 if (_instance.valueAsString != null) { | 220 if (_instance.valueAsString != null) { |
221 members.add(new DivElement()..classes = const ['memberItem'] | 221 members.add(new DivElement()..classes = ['memberItem'] |
222 ..children = [ | 222 ..children = [ |
223 new DivElement()..classes = const ['memberName'] | 223 new DivElement()..classes = ['memberName'] |
224 ..text = _instance.kind == M.InstanceKind.string | 224 ..text = _instance.kind == M.InstanceKind.string |
225 ? 'value as literal' | 225 ? 'value as literal' |
226 : 'value', | 226 : 'value', |
227 new DivElement()..classes = const ['memberValue'] | 227 new DivElement()..classes = ['memberValue'] |
228 ..text = _instance.kind == M.InstanceKind.string | 228 ..text = _instance.kind == M.InstanceKind.string |
229 ? Utils.formatStringAsLiteral(_instance.valueAsString, | 229 ? Utils.formatStringAsLiteral(_instance.valueAsString, |
230 _instance.valueAsStringIsTruncated) | 230 _instance.valueAsStringIsTruncated) |
231 : _instance.valueAsString | 231 : _instance.valueAsString |
232 ]); | 232 ]); |
233 } | 233 } |
234 if (_instance.typeClass != null) { | 234 if (_instance.typeClass != null) { |
235 members.add(new DivElement()..classes = const ['memberItem'] | 235 members.add(new DivElement()..classes = ['memberItem'] |
236 ..children = [ | 236 ..children = [ |
237 new DivElement()..classes = const ['memberName'] | 237 new DivElement()..classes = ['memberName'] |
238 ..text = 'type class', | 238 ..text = 'type class', |
239 new DivElement()..classes = const ['memberValue'] | 239 new DivElement()..classes = ['memberValue'] |
240 ..children = [ | 240 ..children = [ |
241 new ClassRefElement(_isolate, _instance.typeClass, | 241 new ClassRefElement(_isolate, _instance.typeClass, |
242 queue: _r.queue) | 242 queue: _r.queue) |
243 ] | 243 ] |
244 ]); | 244 ]); |
245 } | 245 } |
246 if (_typeArguments != null && _typeArguments.types.isNotEmpty) { | 246 if (_typeArguments != null && _typeArguments.types.isNotEmpty) { |
247 members.add(new DivElement()..classes = const ['memberItem'] | 247 members.add(new DivElement()..classes = ['memberItem'] |
248 ..children = [ | 248 ..children = [ |
249 new DivElement()..classes = const ['memberName'] | 249 new DivElement()..classes = ['memberName'] |
250 ..text = 'type arguments', | 250 ..text = 'type arguments', |
251 new DivElement()..classes = const ['memberValue'] | 251 new DivElement()..classes = ['memberValue'] |
252 ..children = ([ | 252 ..children = ([ |
253 new SpanElement()..text = '< ' | 253 new SpanElement()..text = '< ' |
254 ] | 254 ] |
255 ..addAll(_typeArguments.types.expand((type) => [ | 255 ..addAll(_typeArguments.types.expand((type) => [ |
256 new InstanceRefElement(_isolate, type, _instances, queue: | 256 new InstanceRefElement(_isolate, type, _instances, queue: |
257 _r.queue), | 257 _r.queue), |
258 new SpanElement()..text = ', ' | 258 new SpanElement()..text = ', ' |
259 ])) | 259 ])) |
260 ..removeLast() | 260 ..removeLast() |
261 ..add(new SpanElement()..text = ' >')) | 261 ..add(new SpanElement()..text = ' >')) |
262 ]); | 262 ]); |
263 } | 263 } |
264 if (_instance.parameterizedClass != null) { | 264 if (_instance.parameterizedClass != null) { |
265 members.add(new DivElement()..classes = const ['memberItem'] | 265 members.add(new DivElement()..classes = ['memberItem'] |
266 ..children = [ | 266 ..children = [ |
267 new DivElement()..classes = const ['memberName'] | 267 new DivElement()..classes = ['memberName'] |
268 ..text = 'parameterized class', | 268 ..text = 'parameterized class', |
269 new DivElement()..classes = const ['memberValue'] | 269 new DivElement()..classes = ['memberValue'] |
270 ..children = [ | 270 ..children = [ |
271 new ClassRefElement(_isolate, _instance.parameterizedClass, | 271 new ClassRefElement(_isolate, _instance.parameterizedClass, |
272 queue: _r.queue) | 272 queue: _r.queue) |
273 ] | 273 ] |
274 ]); | 274 ]); |
275 } | 275 } |
276 if (_instance.parameterIndex != null) { | 276 if (_instance.parameterIndex != null) { |
277 members.add(new DivElement()..classes = const ['memberItem'] | 277 members.add(new DivElement()..classes = ['memberItem'] |
278 ..children = [ | 278 ..children = [ |
279 new DivElement()..classes = const ['memberName'] | 279 new DivElement()..classes = ['memberName'] |
280 ..text = 'parameter index', | 280 ..text = 'parameter index', |
281 new DivElement()..classes = const ['memberValue'] | 281 new DivElement()..classes = ['memberValue'] |
282 ..text = '${_instance.parameterIndex}' | 282 ..text = '${_instance.parameterIndex}' |
283 ]); | 283 ]); |
284 } | 284 } |
285 if (_instance.targetType != null) { | 285 if (_instance.targetType != null) { |
286 members.add(new DivElement()..classes = const ['memberItem'] | 286 members.add(new DivElement()..classes = ['memberItem'] |
287 ..children = [ | 287 ..children = [ |
288 new DivElement()..classes = const ['memberName'] | 288 new DivElement()..classes = ['memberName'] |
289 ..text = 'target type', | 289 ..text = 'target type', |
290 new DivElement()..classes = const ['memberValue'] | 290 new DivElement()..classes = ['memberValue'] |
291 ..children = [ | 291 ..children = [ |
292 new InstanceRefElement(_isolate, _instance.targetType, _instances, | 292 new InstanceRefElement(_isolate, _instance.targetType, _instances, |
293 queue: _r.queue) | 293 queue: _r.queue) |
294 ] | 294 ] |
295 ]); | 295 ]); |
296 } | 296 } |
297 if (_instance.bound != null) { | 297 if (_instance.bound != null) { |
298 members.add(new DivElement()..classes = const ['memberItem'] | 298 members.add(new DivElement()..classes = ['memberItem'] |
299 ..children = [ | 299 ..children = [ |
300 new DivElement()..classes = const ['memberName'] | 300 new DivElement()..classes = ['memberName'] |
301 ..text = 'bound', | 301 ..text = 'bound', |
302 new DivElement()..classes = const ['memberValue'] | 302 new DivElement()..classes = ['memberValue'] |
303 ..children = [ | 303 ..children = [ |
304 new InstanceRefElement(_isolate, _instance.bound, _instances, | 304 new InstanceRefElement(_isolate, _instance.bound, _instances, |
305 queue: _r.queue) | 305 queue: _r.queue) |
306 ] | 306 ] |
307 ]); | 307 ]); |
308 } | 308 } |
309 if (_instance.closureFunction != null) { | 309 if (_instance.closureFunction != null) { |
310 members.add(new DivElement()..classes = const ['memberItem'] | 310 members.add(new DivElement()..classes = ['memberItem'] |
311 ..children = [ | 311 ..children = [ |
312 new DivElement()..classes = const ['memberName'] | 312 new DivElement()..classes = ['memberName'] |
313 ..text = 'closure function', | 313 ..text = 'closure function', |
314 new DivElement()..classes = const ['memberValue'] | 314 new DivElement()..classes = ['memberValue'] |
315 ..children = [ | 315 ..children = [ |
316 new FunctionRefElement(_isolate, _instance.closureFunction, | 316 new FunctionRefElement(_isolate, _instance.closureFunction, |
317 queue: _r.queue) | 317 queue: _r.queue) |
318 ] | 318 ] |
319 ]); | 319 ]); |
320 } | 320 } |
321 if (_instance.closureContext != null) { | 321 if (_instance.closureContext != null) { |
322 members.add(new DivElement()..classes = const ['memberItem'] | 322 members.add(new DivElement()..classes = ['memberItem'] |
323 ..children = [ | 323 ..children = [ |
324 new DivElement()..classes = const ['memberName'] | 324 new DivElement()..classes = ['memberName'] |
325 ..text = 'closure context', | 325 ..text = 'closure context', |
326 new DivElement()..classes = const ['memberValue'] | 326 new DivElement()..classes = ['memberValue'] |
327 ..children = [ | 327 ..children = [ |
328 new ContextRefElement(_isolate, _instance.closureContext, | 328 new ContextRefElement(_isolate, _instance.closureContext, |
329 queue: _r.queue) | 329 queue: _r.queue) |
330 ] | 330 ] |
331 ]); | 331 ]); |
332 } | 332 } |
333 if (_instance.kind == M.InstanceKind.closure) { | 333 if (_instance.kind == M.InstanceKind.closure) { |
334 ButtonElement btn; | 334 ButtonElement btn; |
335 members.add(new DivElement()..classes = const ['memberItem'] | 335 members.add(new DivElement()..classes = ['memberItem'] |
336 ..children = [ | 336 ..children = [ |
337 new DivElement()..classes = const ['memberName'] | 337 new DivElement()..classes = ['memberName'] |
338 ..text = 'closure breakpoint', | 338 ..text = 'closure breakpoint', |
339 new DivElement()..classes = const ['memberValue'] | 339 new DivElement()..classes = ['memberValue'] |
340 ..children = [ | 340 ..children = [ |
341 btn = new ButtonElement() | 341 btn = new ButtonElement() |
342 ..text = _instance.activationBreakpoint == null | 342 ..text = _instance.activationBreakpoint == null |
343 ? 'break on activation' | 343 ? 'break on activation' |
344 : 'remove' | 344 : 'remove' |
345 ..onClick.listen((_) { | 345 ..onClick.listen((_) { |
346 btn.disabled = true; | 346 btn.disabled = true; |
347 _toggleBreakpoint(); | 347 _toggleBreakpoint(); |
348 }) | 348 }) |
349 ] | 349 ] |
350 ]); | 350 ]); |
351 } | 351 } |
352 | 352 |
353 if (_instance.nativeFields != null && _instance.nativeFields.isNotEmpty) { | 353 if (_instance.nativeFields != null && _instance.nativeFields.isNotEmpty) { |
354 int i = 0; | 354 int i = 0; |
355 members.add(new DivElement()..classes = const ['memberItem'] | 355 members.add(new DivElement()..classes = ['memberItem'] |
356 ..children = [ | 356 ..children = [ |
357 new DivElement()..classes = const ['memberName'] | 357 new DivElement()..classes = ['memberName'] |
358 ..text = 'native fields (${_instance.nativeFields.length})', | 358 ..text = 'native fields (${_instance.nativeFields.length})', |
359 new DivElement()..classes = const ['memberName'] | 359 new DivElement()..classes = ['memberName'] |
360 ..children = [ | 360 ..children = [ |
361 new CurlyBlockElement( | 361 new CurlyBlockElement( |
362 expanded: _instance.nativeFields.length <= 100, | 362 expanded: _instance.nativeFields.length <= 100, |
363 queue: _r.queue) | 363 queue: _r.queue) |
364 ..children = [ | 364 ..children = [ |
365 new DivElement()..classes = const ['memberList'] | 365 new DivElement()..classes = ['memberList'] |
366 ..children = _instance.nativeFields.map((f) => | 366 ..children = _instance.nativeFields.map((f) => |
367 new DivElement()..classes = const ['memberItem'] | 367 new DivElement()..classes = ['memberItem'] |
368 ..children = [ | 368 ..children = [ |
369 new DivElement()..classes = const ['memberName'] | 369 new DivElement()..classes = ['memberName'] |
370 ..text = '[ ${i++} ]', | 370 ..text = '[ ${i++} ]', |
371 new DivElement()..classes = const ['memberValue'] | 371 new DivElement()..classes = ['memberValue'] |
372 ..text = '[ ${f.value} ]' | 372 ..text = '[ ${f.value} ]' |
373 ]).toList() | 373 ]).toList() |
374 ] | 374 ] |
375 ] | 375 ] |
376 ]); | 376 ]); |
377 } | 377 } |
378 | 378 |
379 if (_instance.fields != null && _instance.fields.isNotEmpty) { | 379 if (_instance.fields != null && _instance.fields.isNotEmpty) { |
380 final fields = _instance.fields.toList(); | 380 final fields = _instance.fields.toList(); |
381 members.add(new DivElement()..classes = const ['memberItem'] | 381 members.add(new DivElement()..classes = ['memberItem'] |
382 ..children = [ | 382 ..children = [ |
383 new DivElement()..classes = const ['memberName'] | 383 new DivElement()..classes = ['memberName'] |
384 ..text = 'fields (${fields.length})', | 384 ..text = 'fields (${fields.length})', |
385 new DivElement()..classes = const ['memberName'] | 385 new DivElement()..classes = ['memberName'] |
386 ..children = [ | 386 ..children = [ |
387 new CurlyBlockElement( | 387 new CurlyBlockElement( |
388 expanded: fields.length <= 100, | 388 expanded: fields.length <= 100, |
389 queue: _r.queue) | 389 queue: _r.queue) |
390 ..children = [ | 390 ..children = [ |
391 new DivElement()..classes = const ['memberList'] | 391 new DivElement()..classes = ['memberList'] |
392 ..children = fields.map((f) => | 392 ..children = fields.map((f) => |
393 new DivElement()..classes = const ['memberItem'] | 393 new DivElement()..classes = ['memberItem'] |
394 ..children = [ | 394 ..children = [ |
395 new DivElement()..classes = const ['memberName'] | 395 new DivElement()..classes = ['memberName'] |
396 ..children = [ | 396 ..children = [ |
397 new FieldRefElement(_isolate, f.decl, _instances, | 397 new FieldRefElement(_isolate, f.decl, _instances, |
398 queue: _r.queue) | 398 queue: _r.queue) |
399 ], | 399 ], |
400 new DivElement()..classes = const ['memberValue'] | 400 new DivElement()..classes = ['memberValue'] |
401 ..children = [ | 401 ..children = [ |
402 new SpanElement()..text = ' = ', | 402 new SpanElement()..text = ' = ', |
403 anyRef(_isolate, f.value, _instances, | 403 anyRef(_isolate, f.value, _instances, |
404 queue: _r.queue) | 404 queue: _r.queue) |
405 ] | 405 ] |
406 ]).toList() | 406 ]).toList() |
407 ] | 407 ] |
408 ] | 408 ] |
409 ]); | 409 ]); |
410 } | 410 } |
411 | 411 |
412 if (_instance.elements != null && _instance.elements.isNotEmpty) { | 412 if (_instance.elements != null && _instance.elements.isNotEmpty) { |
413 final elements = _instance.elements.toList(); | 413 final elements = _instance.elements.toList(); |
414 int i = 0; | 414 int i = 0; |
415 members.add(new DivElement()..classes = const ['memberItem'] | 415 members.add(new DivElement()..classes = ['memberItem'] |
416 ..children = [ | 416 ..children = [ |
417 new DivElement()..classes = const ['memberName'] | 417 new DivElement()..classes = ['memberName'] |
418 ..text = 'elements (${_instance.length})', | 418 ..text = 'elements (${_instance.length})', |
419 new DivElement()..classes = const ['memberValue'] | 419 new DivElement()..classes = ['memberValue'] |
420 ..children = [ | 420 ..children = [ |
421 new CurlyBlockElement( | 421 new CurlyBlockElement( |
422 expanded: elements.length <= 100, | 422 expanded: elements.length <= 100, |
423 queue: _r.queue) | 423 queue: _r.queue) |
424 ..children = [ | 424 ..children = [ |
425 new DivElement()..classes = const ['memberList'] | 425 new DivElement()..classes = ['memberList'] |
426 ..children = elements.map((e) => | 426 ..children = elements.map((e) => |
427 new DivElement()..classes = const ['memberItem'] | 427 new DivElement()..classes = ['memberItem'] |
428 ..children = [ | 428 ..children = [ |
429 new DivElement()..classes = const ['memberName'] | 429 new DivElement()..classes = ['memberName'] |
430 ..text = '[ ${i++} ]', | 430 ..text = '[ ${i++} ]', |
431 new DivElement()..classes = const ['memberValue'] | 431 new DivElement()..classes = ['memberValue'] |
432 ..children = [ | 432 ..children = [ |
433 anyRef(_isolate, e, _instances, | 433 anyRef(_isolate, e, _instances, |
434 queue: _r.queue) | 434 queue: _r.queue) |
435 ] | 435 ] |
436 ]).toList() | 436 ]).toList() |
437 ] | 437 ] |
438 ] | 438 ] |
439 ]); | 439 ]); |
440 if (_instance.length != elements.length) { | 440 if (_instance.length != elements.length) { |
441 members.add(new DivElement()..classes = const ['memberItem'] | 441 members.add(new DivElement()..classes = ['memberItem'] |
442 ..children = [ | 442 ..children = [ |
443 new DivElement()..classes = const ['memberName'] | 443 new DivElement()..classes = ['memberName'] |
444 ..text = '...', | 444 ..text = '...', |
445 new DivElement()..classes = const ['memberValue'] | 445 new DivElement()..classes = ['memberValue'] |
446 ..text = '${_instance.length - elements.length} omitted elements' | 446 ..text = '${_instance.length - elements.length} omitted elements' |
447 ]); | 447 ]); |
448 } | 448 } |
449 } | 449 } |
450 | 450 |
451 if (_instance.associations != null && _instance.associations.isNotEmpty) { | 451 if (_instance.associations != null && _instance.associations.isNotEmpty) { |
452 final associations = _instance.associations.toList(); | 452 final associations = _instance.associations.toList(); |
453 members.add(new DivElement()..classes = const ['memberItem'] | 453 members.add(new DivElement()..classes = ['memberItem'] |
454 ..children = [ | 454 ..children = [ |
455 new DivElement()..classes = const ['memberName'] | 455 new DivElement()..classes = ['memberName'] |
456 ..text = 'associations (${_instance.length})', | 456 ..text = 'associations (${_instance.length})', |
457 new DivElement()..classes = const ['memberName'] | 457 new DivElement()..classes = ['memberName'] |
458 ..children = [ | 458 ..children = [ |
459 new CurlyBlockElement( | 459 new CurlyBlockElement( |
460 expanded: associations.length <= 100, | 460 expanded: associations.length <= 100, |
461 queue: _r.queue) | 461 queue: _r.queue) |
462 ..children = [ | 462 ..children = [ |
463 new DivElement()..classes = const ['memberList'] | 463 new DivElement()..classes = ['memberList'] |
464 ..children = associations.map((a) => | 464 ..children = associations.map((a) => |
465 new DivElement()..classes = const ['memberItem'] | 465 new DivElement()..classes = ['memberItem'] |
466 ..children = [ | 466 ..children = [ |
467 new DivElement()..classes = const ['memberName'] | 467 new DivElement()..classes = ['memberName'] |
468 ..children = [ | 468 ..children = [ |
469 new SpanElement()..text = '[ ', | 469 new SpanElement()..text = '[ ', |
470 anyRef(_isolate, a.key, _instances, | 470 anyRef(_isolate, a.key, _instances, |
471 queue: _r.queue), | 471 queue: _r.queue), |
472 new SpanElement()..text = ' ]', | 472 new SpanElement()..text = ' ]', |
473 ], | 473 ], |
474 new DivElement()..classes = const ['memberValue'] | 474 new DivElement()..classes = ['memberValue'] |
475 ..children = [ | 475 ..children = [ |
476 anyRef(_isolate, a.value, _instances, | 476 anyRef(_isolate, a.value, _instances, |
477 queue: _r.queue) | 477 queue: _r.queue) |
478 ] | 478 ] |
479 ]).toList() | 479 ]).toList() |
480 ] | 480 ] |
481 ] | 481 ] |
482 ]); | 482 ]); |
483 if (_instance.length != associations.length) { | 483 if (_instance.length != associations.length) { |
484 members.add(new DivElement()..classes = const ['memberItem'] | 484 members.add(new DivElement()..classes = ['memberItem'] |
485 ..children = [ | 485 ..children = [ |
486 new DivElement()..classes = const ['memberName'] | 486 new DivElement()..classes = ['memberName'] |
487 ..text = '...', | 487 ..text = '...', |
488 new DivElement()..classes = const ['memberValue'] | 488 new DivElement()..classes = ['memberValue'] |
489 ..text = '${_instance.length - associations.length} ' | 489 ..text = '${_instance.length - associations.length} ' |
490 'omitted elements' | 490 'omitted elements' |
491 ]); | 491 ]); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 if (_instance.typedElements != null && _instance.typedElements.isNotEmpty) { | 495 if (_instance.typedElements != null && _instance.typedElements.isNotEmpty) { |
496 final typedElements = _instance.typedElements.toList(); | 496 final typedElements = _instance.typedElements.toList(); |
497 int i = 0; | 497 int i = 0; |
498 members.add(new DivElement()..classes = const ['memberItem'] | 498 members.add(new DivElement()..classes = ['memberItem'] |
499 ..children = [ | 499 ..children = [ |
500 new DivElement()..classes = const ['memberName'] | 500 new DivElement()..classes = ['memberName'] |
501 ..text = 'elements (${_instance.length})', | 501 ..text = 'elements (${_instance.length})', |
502 new DivElement()..classes = const ['memberValue'] | 502 new DivElement()..classes = ['memberValue'] |
503 ..children = [ | 503 ..children = [ |
504 new CurlyBlockElement( | 504 new CurlyBlockElement( |
505 expanded: typedElements.length <= 100, | 505 expanded: typedElements.length <= 100, |
506 queue: _r.queue) | 506 queue: _r.queue) |
507 ..children = [ | 507 ..children = [ |
508 new DivElement()..classes = const ['memberList'] | 508 new DivElement()..classes = ['memberList'] |
509 ..children = typedElements.map((e) => | 509 ..children = typedElements.map((e) => |
510 new DivElement()..classes = const ['memberItem'] | 510 new DivElement()..classes = ['memberItem'] |
511 ..children = [ | 511 ..children = [ |
512 new DivElement()..classes = const ['memberName'] | 512 new DivElement()..classes = ['memberName'] |
513 ..text = '[ ${i++} ]', | 513 ..text = '[ ${i++} ]', |
514 new DivElement()..classes = const ['memberValue'] | 514 new DivElement()..classes = ['memberValue'] |
515 ..text = '$e' | 515 ..text = '$e' |
516 ]).toList() | 516 ]).toList() |
517 ] | 517 ] |
518 ] | 518 ] |
519 ]); | 519 ]); |
520 if (_instance.length != typedElements.length) { | 520 if (_instance.length != typedElements.length) { |
521 members.add(new DivElement()..classes = const ['memberItem'] | 521 members.add(new DivElement()..classes = ['memberItem'] |
522 ..children = [ | 522 ..children = [ |
523 new DivElement()..classes = const ['memberName'] | 523 new DivElement()..classes = ['memberName'] |
524 ..text = '...', | 524 ..text = '...', |
525 new DivElement()..classes = const ['memberValue'] | 525 new DivElement()..classes = ['memberValue'] |
526 ..text = '${_instance.length - typedElements.length} ' | 526 ..text = '${_instance.length - typedElements.length} ' |
527 'omitted elements' | 527 'omitted elements' |
528 ]); | 528 ]); |
529 } | 529 } |
530 } | 530 } |
531 | 531 |
532 if (_instance.kind == M.InstanceKind.regExp) { | 532 if (_instance.kind == M.InstanceKind.regExp) { |
533 members.addAll([ | 533 members.addAll([ |
534 new DivElement()..classes = const ['memberItem'] | 534 new DivElement()..classes = ['memberItem'] |
535 ..children = [ | 535 ..children = [ |
536 new DivElement()..classes = const ['memberName'] | 536 new DivElement()..classes = ['memberName'] |
537 ..text = 'pattern', | 537 ..text = 'pattern', |
538 new DivElement()..classes = const ['memberValue'] | 538 new DivElement()..classes = ['memberValue'] |
539 ..children = [ | 539 ..children = [ |
540 anyRef(_isolate, _instance.pattern, _instances, queue: _r.queue) | 540 anyRef(_isolate, _instance.pattern, _instances, queue: _r.queue) |
541 ] | 541 ] |
542 ], | 542 ], |
543 new DivElement()..classes = const ['memberItem'] | 543 new DivElement()..classes = ['memberItem'] |
544 ..children = [ | 544 ..children = [ |
545 new DivElement()..classes = const ['memberName'] | 545 new DivElement()..classes = ['memberName'] |
546 ..text = 'isCaseSensitive', | 546 ..text = 'isCaseSensitive', |
547 new DivElement()..classes = const ['memberValue'] | 547 new DivElement()..classes = ['memberValue'] |
548 ..text = _instance.isCaseSensitive ? 'yes' : 'no' | 548 ..text = _instance.isCaseSensitive ? 'yes' : 'no' |
549 ], | 549 ], |
550 new DivElement()..classes = const ['memberItem'] | 550 new DivElement()..classes = ['memberItem'] |
551 ..children = [ | 551 ..children = [ |
552 new DivElement()..classes = const ['memberName'] | 552 new DivElement()..classes = ['memberName'] |
553 ..text = 'isMultiLine', | 553 ..text = 'isMultiLine', |
554 new DivElement()..classes = const ['memberValue'] | 554 new DivElement()..classes = ['memberValue'] |
555 ..text = _instance.isMultiLine ? 'yes' : 'no' | 555 ..text = _instance.isMultiLine ? 'yes' : 'no' |
556 ], | 556 ], |
557 new DivElement()..classes = const ['memberItem'] | 557 new DivElement()..classes = ['memberItem'] |
558 ..children = [ | 558 ..children = [ |
559 new DivElement()..classes = const ['memberName'] | 559 new DivElement()..classes = ['memberName'] |
560 ..text = 'oneByteFunction', | 560 ..text = 'oneByteFunction', |
561 new DivElement()..classes = const ['memberValue'] | 561 new DivElement()..classes = ['memberValue'] |
562 ..children = [ | 562 ..children = [ |
563 new FunctionRefElement(_isolate, _instance.oneByteFunction, | 563 new FunctionRefElement(_isolate, _instance.oneByteFunction, |
564 queue: _r.queue) | 564 queue: _r.queue) |
565 ] | 565 ] |
566 ], | 566 ], |
567 new DivElement()..classes = const ['memberItem'] | 567 new DivElement()..classes = ['memberItem'] |
568 ..children = [ | 568 ..children = [ |
569 new DivElement()..classes = const ['memberName'] | 569 new DivElement()..classes = ['memberName'] |
570 ..text = 'twoByteFunction', | 570 ..text = 'twoByteFunction', |
571 new DivElement()..classes = const ['memberValue'] | 571 new DivElement()..classes = ['memberValue'] |
572 ..children = [ | 572 ..children = [ |
573 new FunctionRefElement(_isolate, _instance.twoByteFunction, | 573 new FunctionRefElement(_isolate, _instance.twoByteFunction, |
574 queue: _r.queue) | 574 queue: _r.queue) |
575 ] | 575 ] |
576 ], | 576 ], |
577 new DivElement()..classes = const ['memberItem'] | 577 new DivElement()..classes = ['memberItem'] |
578 ..children = [ | 578 ..children = [ |
579 new DivElement()..classes = const ['memberName'] | 579 new DivElement()..classes = ['memberName'] |
580 ..text = 'externalOneByteFunction', | 580 ..text = 'externalOneByteFunction', |
581 new DivElement()..classes = const ['memberValue'] | 581 new DivElement()..classes = ['memberValue'] |
582 ..children = [ | 582 ..children = [ |
583 new FunctionRefElement(_isolate, | 583 new FunctionRefElement(_isolate, |
584 _instance.externalOneByteFunction, | 584 _instance.externalOneByteFunction, |
585 queue: _r.queue) | 585 queue: _r.queue) |
586 ] | 586 ] |
587 ], | 587 ], |
588 new DivElement()..classes = const ['memberItem'] | 588 new DivElement()..classes = ['memberItem'] |
589 ..children = [ | 589 ..children = [ |
590 new DivElement()..classes = const ['memberName'] | 590 new DivElement()..classes = ['memberName'] |
591 ..text = 'externalTwoByteFunction', | 591 ..text = 'externalTwoByteFunction', |
592 new DivElement()..classes = const ['memberValue'] | 592 new DivElement()..classes = ['memberValue'] |
593 ..children = [ | 593 ..children = [ |
594 new FunctionRefElement(_isolate, | 594 new FunctionRefElement(_isolate, |
595 _instance.externalTwoByteFunction, | 595 _instance.externalTwoByteFunction, |
596 queue: _r.queue) | 596 queue: _r.queue) |
597 ] | 597 ] |
598 ], | 598 ], |
599 new DivElement()..classes = const ['memberItem'] | 599 new DivElement()..classes = ['memberItem'] |
600 ..children = [ | 600 ..children = [ |
601 new DivElement()..classes = const ['memberName'] | 601 new DivElement()..classes = ['memberName'] |
602 ..text = 'oneByteBytecode', | 602 ..text = 'oneByteBytecode', |
603 new DivElement()..classes = const ['memberValue'] | 603 new DivElement()..classes = ['memberValue'] |
604 ..children = [ | 604 ..children = [ |
605 new InstanceRefElement(_isolate, _instance.oneByteBytecode, | 605 new InstanceRefElement(_isolate, _instance.oneByteBytecode, |
606 _instances, queue: _r.queue) | 606 _instances, queue: _r.queue) |
607 ] | 607 ] |
608 ], | 608 ], |
609 new DivElement()..classes = const ['memberItem'] | 609 new DivElement()..classes = ['memberItem'] |
610 ..children = [ | 610 ..children = [ |
611 new DivElement()..classes = const ['memberName'] | 611 new DivElement()..classes = ['memberName'] |
612 ..text = 'twoByteBytecode', | 612 ..text = 'twoByteBytecode', |
613 new DivElement()..classes = const ['memberValue'] | 613 new DivElement()..classes = ['memberValue'] |
614 ..children = [ | 614 ..children = [ |
615 new InstanceRefElement(_isolate, _instance.twoByteBytecode, | 615 new InstanceRefElement(_isolate, _instance.twoByteBytecode, |
616 _instances, queue: _r.queue) | 616 _instances, queue: _r.queue) |
617 ] | 617 ] |
618 ] | 618 ] |
619 ]); | 619 ]); |
620 } | 620 } |
621 | 621 |
622 if (_instance.kind == M.InstanceKind.mirrorReference) { | 622 if (_instance.kind == M.InstanceKind.mirrorReference) { |
623 members.add(new DivElement()..classes = const ['memberItem'] | 623 members.add(new DivElement()..classes = ['memberItem'] |
624 ..children = [ | 624 ..children = [ |
625 new DivElement()..classes = const ['memberName'] | 625 new DivElement()..classes = ['memberName'] |
626 ..text = 'referent', | 626 ..text = 'referent', |
627 new DivElement()..classes = const ['memberValue'] | 627 new DivElement()..classes = ['memberValue'] |
628 ..children = [ | 628 ..children = [ |
629 new ContextRefElement(_isolate, _instance.referent, | 629 new ContextRefElement(_isolate, _instance.referent, |
630 queue: _r.queue) | 630 queue: _r.queue) |
631 ] | 631 ] |
632 ]); | 632 ]); |
633 } | 633 } |
634 if (_instance.kind == M.InstanceKind.weakProperty) { | 634 if (_instance.kind == M.InstanceKind.weakProperty) { |
635 members.addAll([ | 635 members.addAll([ |
636 new DivElement()..classes = const ['memberItem'] | 636 new DivElement()..classes = ['memberItem'] |
637 ..children = [ | 637 ..children = [ |
638 new DivElement()..classes = const ['memberName'] | 638 new DivElement()..classes = ['memberName'] |
639 ..text = 'key', | 639 ..text = 'key', |
640 new DivElement()..classes = const ['memberValue'] | 640 new DivElement()..classes = ['memberValue'] |
641 ..children = [ | 641 ..children = [ |
642 new InstanceRefElement(_isolate, _instance.key, _instances, | 642 new InstanceRefElement(_isolate, _instance.key, _instances, |
643 queue: _r.queue), | 643 queue: _r.queue), |
644 ] | 644 ] |
645 ], | 645 ], |
646 new DivElement()..classes = const ['memberItem'] | 646 new DivElement()..classes = ['memberItem'] |
647 ..children = [ | 647 ..children = [ |
648 new DivElement()..classes = const ['memberName'] | 648 new DivElement()..classes = ['memberName'] |
649 ..text = 'value', | 649 ..text = 'value', |
650 new DivElement()..classes = const ['memberValue'] | 650 new DivElement()..classes = ['memberValue'] |
651 ..children = [ | 651 ..children = [ |
652 new InstanceRefElement(_isolate, _instance.value, _instances, | 652 new InstanceRefElement(_isolate, _instance.value, _instances, |
653 queue: _r.queue), | 653 queue: _r.queue), |
654 ] | 654 ] |
655 ] | 655 ] |
656 ]); | 656 ]); |
657 } | 657 } |
658 return members; | 658 return members; |
659 } | 659 } |
660 | 660 |
(...skipping 23 matching lines...) Expand all Loading... |
684 | 684 |
685 Future _toggleBreakpoint() async { | 685 Future _toggleBreakpoint() async { |
686 if (_instance.activationBreakpoint == null) { | 686 if (_instance.activationBreakpoint == null) { |
687 await _breakpoints.addOnActivation(_isolate, _instance); | 687 await _breakpoints.addOnActivation(_isolate, _instance); |
688 } else { | 688 } else { |
689 await _breakpoints.remove(_isolate, _instance.activationBreakpoint); | 689 await _breakpoints.remove(_isolate, _instance.activationBreakpoint); |
690 } | 690 } |
691 await _refresh(); | 691 await _refresh(); |
692 } | 692 } |
693 } | 693 } |
OLD | NEW |