Skip to content

Commit 0404ded

Browse files
authored
fix toString not work in Local Variables panel until all variables defined in scope #2254 (#2255)
* fix watch panel custom string representation. #2252 * fix toString not work in Local Variables panel until all variables defined in scope #2254
1 parent ed9ebac commit 0404ded

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/adapter/templates/getStringyProps.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ export const getStringyProps = templateFunction(function(
4040
return out;
4141
}
4242

43-
for (const [key, value] of Object.entries(this)) {
43+
for (const key of Object.keys(this)) {
44+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
45+
let value: any;
46+
try {
47+
value = this[key];
48+
} catch (e) {
49+
continue;
50+
}
4451
if (customToString) {
4552
try {
4653
const repr = customToString.call(value, defaultPlaceholder);

0 commit comments

Comments
 (0)