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

Side by Side Diff: runtime/observatory/lib/src/elements/instance_ref.dart

Issue 2342943002: Observatory: Fix instance view of lists. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
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 import 'dart:html'; 5 import 'dart:html';
6 import 'dart:async'; 6 import 'dart:async';
7 import 'package:observatory/models.dart' as M; 7 import 'package:observatory/models.dart' as M;
8 import 'package:observatory/src/elements/curly_block.dart'; 8 import 'package:observatory/src/elements/curly_block.dart';
9 import 'package:observatory/src/elements/field_ref.dart'; 9 import 'package:observatory/src/elements/field_ref.dart';
10 import 'package:observatory/src/elements/helpers/any_ref.dart'; 10 import 'package:observatory/src/elements/helpers/any_ref.dart';
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 return [new SpanElement()..text = 'Loading...']; 237 return [new SpanElement()..text = 'Loading...'];
238 } 238 }
239 switch (_instance.kind) { 239 switch (_instance.kind) {
240 case M.InstanceKind.plainInstance: 240 case M.InstanceKind.plainInstance:
241 return _loadedInstance.fields.map((f) => 241 return _loadedInstance.fields.map((f) =>
242 new DivElement() 242 new DivElement()
243 ..children = [ 243 ..children = [
244 new FieldRefElement(_isolate, f.decl, _instances, 244 new FieldRefElement(_isolate, f.decl, _instances,
245 queue: _r.queue), 245 queue: _r.queue),
246 new SpanElement()..text = ' = ', 246 new SpanElement()..text = ' = ',
247 f.value.isSentinel 247 anyRef(_isolate, f.value, _instances, queue: _r.queue)
248 ? new SentinelValueElement(f.value.asSentinel, queue: _r.queue)
249 : new InstanceRefElement(_isolate, f.value.asValue, _instances,
250 queue: _r.queue)
251 ]).toList(); 248 ]).toList();
252 case M.InstanceKind.list: 249 case M.InstanceKind.list:
253 var index = 0; 250 var index = 0;
254 return _loadedInstance.elements.map((e) => 251 return _loadedInstance.elements.map((element) =>
255 new DivElement() 252 new DivElement()
256 ..children = [ 253 ..children = [
257 new SpanElement()..text = '[ ${index++} ] : ', 254 new SpanElement()..text = '[ ${index++} ] : ',
258 e.isSentinel 255 anyRef(_isolate, element, _instances, queue: _r.queue)
259 ? new SentinelValueElement(e.asSentinel, queue: _r.queue)
260 : anyRef(_isolate, e.asValue, _instances, queue: _r.queue)
261 // should be:
262 // new InstanceRefElement(_isolate, e.asValue, _instances,
263 // queue: _r.queue)
264 // in some situations we obtain values that are not InstanceRef.
265 ]).toList()..addAll(_createShowMoreButton()); 256 ]).toList()..addAll(_createShowMoreButton());
266 case M.InstanceKind.map: 257 case M.InstanceKind.map:
267 return _loadedInstance.associations.map((a) => 258 return _loadedInstance.associations.map((association) =>
268 new DivElement() 259 new DivElement()
269 ..children = [ 260 ..children = [
270 new SpanElement()..text = '[ ', 261 new SpanElement()..text = '[ ',
271 a.key.isSentinel 262 anyRef(_isolate, association.key, _instances, queue: _r.queue),
272 ? new SentinelValueElement(a.key.asSentinel, queue: _r.queue)
273 : new InstanceRefElement(_isolate, a.key.asValue, _instances,
274 queue: _r.queue),
275 new SpanElement()..text = ' ] : ', 263 new SpanElement()..text = ' ] : ',
276 a.value.isSentinel 264 anyRef(_isolate, association.value, _instances, queue: _r.queue)
277 ? new SentinelValueElement(a.value.asSentinel, queue: _r.queue)
278 : new InstanceRefElement(_isolate, a.value.asValue, _instances,
279 queue: _r.queue)
280 ]).toList()..addAll(_createShowMoreButton()); 265 ]).toList()..addAll(_createShowMoreButton());
281 case M.InstanceKind.uint8ClampedList: 266 case M.InstanceKind.uint8ClampedList:
282 case M.InstanceKind.uint8List: 267 case M.InstanceKind.uint8List:
283 case M.InstanceKind.uint16List: 268 case M.InstanceKind.uint16List:
284 case M.InstanceKind.uint32List: 269 case M.InstanceKind.uint32List:
285 case M.InstanceKind.uint64List: 270 case M.InstanceKind.uint64List:
286 case M.InstanceKind.int8List: 271 case M.InstanceKind.int8List:
287 case M.InstanceKind.int16List: 272 case M.InstanceKind.int16List:
288 case M.InstanceKind.int32List: 273 case M.InstanceKind.int32List:
289 case M.InstanceKind.int64List: 274 case M.InstanceKind.int64List:
(...skipping 20 matching lines...) Expand all
310 new BRElement(), 295 new BRElement(),
311 new SpanElement()..text = '<value> : ', 296 new SpanElement()..text = '<value> : ',
312 new InstanceRefElement(_isolate, _loadedInstance.value, _instances, 297 new InstanceRefElement(_isolate, _loadedInstance.value, _instances,
313 queue: _r.queue), 298 queue: _r.queue),
314 ]; 299 ];
315 default: 300 default:
316 return []; 301 return [];
317 } 302 }
318 } 303 }
319 } 304 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/helpers/any_ref.dart ('k') | runtime/observatory/lib/src/elements/instance_view.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698