script: let console.log take multiple args and format objects correctly
This commit is contained in:
parent
790d83433d
commit
7d0d368a78
1 changed files with 3 additions and 2 deletions
|
|
@ -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(' '))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue