Skip to content

Commit

Permalink
when evaluating widget.XX in binding and it is an object, stringify i…
Browse files Browse the repository at this point in the history
…t, so user knows which properties are existing
  • Loading branch information
foxriver76 committed Mar 1, 2024
1 parent 677ff7d commit 5ac250d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/src/Vis/visFormatUtils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ class VisFormatUtils {
try {
// eslint-disable-next-line no-new-func
value = new Function(string)();

if (value && typeof value === 'object') {
value = JSON.stringify(value);
}
} catch (e) {
console.error(`Error in eval[value]: ${format}`);
console.error(`Error in eval[script]: ${string}`);
Expand Down Expand Up @@ -497,6 +501,7 @@ class VisFormatUtils {
} // for

format = format.replace(/{{/g, '{').replace(/}}/g, '}');

return format;
}
}
Expand Down

0 comments on commit 5ac250d

Please sign in to comment.