mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-13 10:06:23 +02:00
script: prevent JS breaking when logging circular obj. fixes #224
This commit is contained in:
@ -1840,13 +1840,17 @@ globalConsoleContainerEl
|
||||
'script $1:$2'
|
||||
);
|
||||
}
|
||||
scope.consoleCm.replaceRange(
|
||||
arg +
|
||||
' ' +
|
||||
((arg + '').match(/\[object \w+]/) ? JSON.stringify(arg) : '') +
|
||||
'\n',
|
||||
{ line: Infinity }
|
||||
);
|
||||
try {
|
||||
scope.consoleCm.replaceRange(
|
||||
arg +
|
||||
' ' +
|
||||
((arg + '').match(/\[object \w+]/) ? JSON.stringify(arg) : '') +
|
||||
'\n',
|
||||
{ line: Infinity }
|
||||
);
|
||||
} catch (e) {
|
||||
scope.consoleCm.replaceRange('🌀\n', { line: Infinity });
|
||||
}
|
||||
scope.consoleCm.scrollTo(0, Infinity);
|
||||
logCount++;
|
||||
});
|
||||
|
Reference in New Issue
Block a user