| 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 observatory_element; | 5 library observatory_element; |
| 6 | 6 |
| 7 import 'dart:math'; | 7 import 'dart:math'; |
| 8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 9 | 9 |
| 10 /// Base class for all Observatory custom elements. | 10 /// Base class for all Observatory custom elements. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 String fileAndLine(Map frame) { | 91 String fileAndLine(Map frame) { |
| 92 var file = frame['script']['user_name']; | 92 var file = frame['script']['user_name']; |
| 93 var shortFile = file.substring(file.lastIndexOf('/') + 1); | 93 var shortFile = file.substring(file.lastIndexOf('/') + 1); |
| 94 return "${shortFile}:${frame['line']}"; | 94 return "${shortFile}:${frame['line']}"; |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool isNull(String type) { | 97 bool isNull(String type) { |
| 98 return type == 'Null'; | 98 return type == 'Null'; |
| 99 } | 99 } |
| 100 |
| 101 bool isError(String type) { |
| 102 return type == 'Error'; |
| 103 } |
| 100 | 104 |
| 101 bool isInt(String type) { | 105 bool isInt(String type) { |
| 102 return (type == 'Smi' || | 106 return (type == 'Smi' || |
| 103 type == 'Mint' || | 107 type == 'Mint' || |
| 104 type == 'Bigint'); | 108 type == 'Bigint'); |
| 105 } | 109 } |
| 106 | 110 |
| 107 bool isBool(String type) { | 111 bool isBool(String type) { |
| 108 return type == 'Bool'; | 112 return type == 'Bool'; |
| 109 } | 113 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 128 bool isUnexpected(String type) { | 132 bool isUnexpected(String type) { |
| 129 return (!['Null', | 133 return (!['Null', |
| 130 'Smi', | 134 'Smi', |
| 131 'Mint', | 135 'Mint', |
| 132 'Biginit', | 136 'Biginit', |
| 133 'Bool', | 137 'Bool', |
| 134 'String', | 138 'String', |
| 135 'Closure', | 139 'Closure', |
| 136 'Instance', | 140 'Instance', |
| 137 'GrowableObjectArray', | 141 'GrowableObjectArray', |
| 138 'Array'].contains(type)); | 142 'Array', |
| 143 'Error'].contains(type)); |
| 139 } | 144 } |
| 140 } | 145 } |
| OLD | NEW |