File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Expand file tree Collapse file tree 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 {
288288 //
289289 // For maps and lists it's more complicated. Treat the actual SDK versions
290290 // of these as special.
291- // TODO(alanknight): Handle superclass fields.
292291 final fieldNameExpression = '''function() {
293292 const sdk = ${globalLoadStrategy .loadModuleSnippet }("dart_sdk");
294293 const sdk_utils = sdk.dart;
@@ -302,7 +301,9 @@ class InstanceHelper extends Domain {
302301 const privateFields = sdk_utils.getOwnPropertySymbols(fields);
303302 const nonSymbolNames = privateFields.map(sym => sym.description);
304303 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(',');
306307 }
307308 ''' ;
308309 var allNames = (await inspector
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ void main() {
8484 properties.map ((p) => p.name).where ((x) => x != '__proto__' ).toList ();
8585 var expected = [
8686 '_privateField' ,
87+ 'abstractField' ,
8788 'closure' ,
8889 'count' ,
8990 'message' ,
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ void main() {
141141 instance.fields.map ((boundField) => boundField.decl.name).toList ();
142142 expect (fieldNames, [
143143 '_privateField' ,
144+ 'abstractField' ,
144145 'closure' ,
145146 'count' ,
146147 'message' ,
Original file line number Diff line number Diff line change 33// BSD-style license that can be found in the LICENSE file.
44
55/// An example with more complicated scope
6-
76import 'dart:async' ;
87import 'dart:collection' ;
98
@@ -75,7 +74,11 @@ String libraryFunction(String arg) {
7574 return concat;
7675}
7776
78- class MyTestClass <T > {
77+ abstract class MyAbstractClass {
78+ String abstractField = 'abstract-field-value' ;
79+ }
80+
81+ class MyTestClass <T > extends MyAbstractClass {
7982 final String message;
8083
8184 String notFinal;
You can’t perform that action at this time.
0 commit comments