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

Side by Side Diff: runtime/bin/vmservice/observatory/lib/src/elements/observatory_element.dart

Issue 515303005: Allow observatory to distinguish between user-level and vm-level types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js, fix test Created 6 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 | Annotate | Revision Log
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 library observatory_element; 5 library observatory_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'package:observatory/app.dart'; 9 import 'package:observatory/app.dart';
10 import 'package:polymer/polymer.dart'; 10 import 'package:polymer/polymer.dart';
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 String fileAndLine(Map frame) { 107 String fileAndLine(Map frame) {
108 var file = frame['script'].name; 108 var file = frame['script'].name;
109 var shortFile = file.substring(file.lastIndexOf('/') + 1); 109 var shortFile = file.substring(file.lastIndexOf('/') + 1);
110 return "${shortFile}:${frame['line']}"; 110 return "${shortFile}:${frame['line']}";
111 } 111 }
112 112
113 int parseInt(String value) => int.parse(value); 113 int parseInt(String value) => int.parse(value);
114 114
115 bool isNull(ref) { 115 bool isNull(ref) {
116 return ref != null && ref.serviceType == 'Null'; 116 return ref != null && ref.vmType == 'Null';
117 } 117 }
118 118
119 bool isSentinel(ref) { 119 bool isSentinel(ref) {
120 return ref != null && ref.serviceType == 'Sentinel'; 120 return ref != null && ref.vmType == 'Sentinel';
121 } 121 }
122 122
123 bool isError(ref) { 123 bool isError(ref) {
124 return ref != null && ref.serviceType == 'Error'; 124 return ref != null && ref.vmType == 'Error';
125 } 125 }
126 126
127 bool isInt(ref) { 127 bool isInt(ref) {
128 return ref != null && (ref.serviceType == 'Smi' || 128 return ref != null && (ref.vmType == 'Smi' ||
129 ref.serviceType == 'Mint' || 129 ref.vmType == 'Mint' ||
130 ref.serviceType == 'Bigint'); 130 ref.vmType == 'Bigint');
131 } 131 }
132 132
133 bool isBool(ref) { 133 bool isBool(ref) {
134 return ref != null && ref.serviceType == 'Bool'; 134 return ref != null && ref.vmType == 'Bool';
135 } 135 }
136 136
137 bool isString(ref) { 137 bool isString(ref) {
138 return ref != null && ref.serviceType == 'String'; 138 return ref != null && ref.vmType == 'String';
139 } 139 }
140 140
141 bool isInstance(ref) { 141 bool isInstance(ref) {
142 return ref != null && ref.serviceType == 'Instance'; 142 return ref != null && ref.vmType == 'Instance';
143 } 143 }
144 144
145 bool isDouble(ref) { 145 bool isDouble(ref) {
146 return ref != null && ref.serviceType == 'Double'; 146 return ref != null && ref.vmType == 'Double';
147 } 147 }
148 148
149 bool isList(ref) { 149 bool isList(ref) {
150 return ref != null && (ref.serviceType == 'GrowableObjectArray' || 150 return ref != null && (ref.vmType == 'GrowableObjectArray' ||
151 ref.serviceType == 'Array'); 151 ref.vmType == 'Array');
152 } 152 }
153 153
154 bool isType(ref) { 154 bool isType(ref) {
155 return ref != null && (ref.serviceType == 'Type'); 155 return ref != null && (ref.vmType == 'Type');
156 } 156 }
157 157
158 bool isUnexpected(ref) { 158 bool isUnexpected(ref) {
159 if (ref == null) return false; 159 if (ref == null) return false;
160 return (!['Null', 160 return (!['Null',
161 'Sentinel', 161 'Sentinel',
162 'Smi', 162 'Smi',
163 'Mint', 163 'Mint',
164 'Bigint', 164 'Bigint',
165 'Bool', 165 'Bool',
166 'String', 166 'String',
167 'Double', 167 'Double',
168 'Instance', 168 'Instance',
169 'GrowableObjectArray', 169 'GrowableObjectArray',
170 'Array', 170 'Array',
171 'Type', 171 'Type',
172 'Error'].contains(ref.serviceType)); 172 'Error'].contains(ref.vmType));
173 } 173 }
174 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698