script: let console.log take multiple args and format objects correctly

This commit is contained in:
jean-emmanuel 2025-03-19 17:52:27 +01:00
parent 790d83433d
commit 7d0d368a78

View file

@ -77,8 +77,9 @@ class Vm {
this.sandbox.contentWindow.console = {
...console,
log: (msg)=>{
this.getWidget().log(msg)
log: (...msg)=>{
msg = msg.map(m => typeof m == 'object' ? JSON.stringify(m) : m)
this.getWidget().log(msg.join(' '))
}
}