From 2076c0ea8be6f976dbff401ba6bd640b9afb28bc Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Thu, 20 May 2021 18:56:22 -0700 Subject: [PATCH 1/3] Fix error with getObject on a ClassRef --- dwds/lib/src/debugging/classes.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwds/lib/src/debugging/classes.dart b/dwds/lib/src/debugging/classes.dart index a17f22df4..66208677e 100644 --- a/dwds/lib/src/debugging/classes.dart +++ b/dwds/lib/src/debugging/classes.dart @@ -100,7 +100,7 @@ class ClassHelper extends Domain { var methods = Object.getOwnPropertyNames(proto); for (var i = 0; i < methods.length; i++) { if (methodNames.indexOf(methods[i]) == -1 - && typeof proto[methods[i]] == 'function' + && typeof Object.getOwnPropertyDescriptor(proto,methods[i])['value'] == 'function' && methods[i] != 'constructor') { methodNames.push(methods[i]); } From 89d1ea6899c10e052e4dce6cd30d348681de34e4 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Fri, 21 May 2021 10:19:25 -0700 Subject: [PATCH 2/3] add all properties --- dwds/lib/src/debugging/classes.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/dwds/lib/src/debugging/classes.dart b/dwds/lib/src/debugging/classes.dart index 66208677e..6a05621ec 100644 --- a/dwds/lib/src/debugging/classes.dart +++ b/dwds/lib/src/debugging/classes.dart @@ -100,7 +100,6 @@ class ClassHelper extends Domain { var methods = Object.getOwnPropertyNames(proto); for (var i = 0; i < methods.length; i++) { if (methodNames.indexOf(methods[i]) == -1 - && typeof Object.getOwnPropertyDescriptor(proto,methods[i])['value'] == 'function' && methods[i] != 'constructor') { methodNames.push(methods[i]); } From 88ec32d80aa7e6073940eee831a967c099f29a73 Mon Sep 17 00:00:00 2001 From: Gary Roumanis Date: Fri, 21 May 2021 11:46:14 -0700 Subject: [PATCH 3/3] fix test --- dwds/test/chrome_proxy_service_test.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dwds/test/chrome_proxy_service_test.dart b/dwds/test/chrome_proxy_service_test.dart index 29eca3e4b..f0ce832a5 100644 --- a/dwds/test/chrome_proxy_service_test.dart +++ b/dwds/test/chrome_proxy_service_test.dart @@ -407,14 +407,17 @@ void main() { test('Classes', () async { var testClass = await service.getObject( isolate.id, rootLibrary.classes.first.id) as Class; - expect( testClass.functions, unorderedEquals([ + predicate((FuncRef f) => f.name == 'message' && !f.isStatic), + predicate((FuncRef f) => f.name == 'notFinal' && !f.isStatic), predicate((FuncRef f) => f.name == 'hello' && !f.isStatic), predicate((FuncRef f) => f.name == '_equals' && !f.isStatic), + predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic), predicate((FuncRef f) => f.name == 'toString' && !f.isStatic), predicate((FuncRef f) => f.name == 'noSuchMethod' && !f.isStatic), + predicate((FuncRef f) => f.name == 'runtimeType' && !f.isStatic), ])); expect( testClass.fields,