File tree 4 files changed +10
-4
lines changed
4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,6 @@ class InstanceHelper extends Domain {
288
288
//
289
289
// For maps and lists it's more complicated. Treat the actual SDK versions
290
290
// of these as special.
291
- // TODO(alanknight): Handle superclass fields.
292
291
final fieldNameExpression = '''function() {
293
292
const sdk = ${globalLoadStrategy .loadModuleSnippet }("dart_sdk");
294
293
const sdk_utils = sdk.dart;
@@ -302,7 +301,9 @@ class InstanceHelper extends Domain {
302
301
const privateFields = sdk_utils.getOwnPropertySymbols(fields);
303
302
const nonSymbolNames = privateFields.map(sym => sym.description);
304
303
const publicFieldNames = sdk_utils.getOwnPropertyNames(fields);
305
- return nonSymbolNames.concat(publicFieldNames).join(',');
304
+ const symbolNames = Object.getOwnPropertySymbols(this)
305
+ .map(sym => sym.description.split('.').slice(-1)[0]);
306
+ return nonSymbolNames.concat(publicFieldNames).concat(symbolNames).join(',');
306
307
}
307
308
''' ;
308
309
var allNames = (await inspector
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ void main() {
84
84
properties.map ((p) => p.name).where ((x) => x != '__proto__' ).toList ();
85
85
var expected = [
86
86
'_privateField' ,
87
+ 'abstractField' ,
87
88
'closure' ,
88
89
'count' ,
89
90
'message' ,
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ void main() {
141
141
instance.fields.map ((boundField) => boundField.decl.name).toList ();
142
142
expect (fieldNames, [
143
143
'_privateField' ,
144
+ 'abstractField' ,
144
145
'closure' ,
145
146
'count' ,
146
147
'message' ,
Original file line number Diff line number Diff line change 3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
5
/// An example with more complicated scope
6
-
7
6
import 'dart:async' ;
8
7
import 'dart:collection' ;
9
8
@@ -75,7 +74,11 @@ String libraryFunction(String arg) {
75
74
return concat;
76
75
}
77
76
78
- class MyTestClass <T > {
77
+ abstract class MyAbstractClass {
78
+ String abstractField = 'abstract-field-value' ;
79
+ }
80
+
81
+ class MyTestClass <T > extends MyAbstractClass {
79
82
final String message;
80
83
81
84
String notFinal;
You can’t perform that action at this time.
0 commit comments