mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-13 18:16:19 +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'
|
'script $1:$2'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
scope.consoleCm.replaceRange(
|
try {
|
||||||
arg +
|
scope.consoleCm.replaceRange(
|
||||||
' ' +
|
arg +
|
||||||
((arg + '').match(/\[object \w+]/) ? JSON.stringify(arg) : '') +
|
' ' +
|
||||||
'\n',
|
((arg + '').match(/\[object \w+]/) ? JSON.stringify(arg) : '') +
|
||||||
{ line: Infinity }
|
'\n',
|
||||||
);
|
{ line: Infinity }
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
scope.consoleCm.replaceRange('🌀\n', { line: Infinity });
|
||||||
|
}
|
||||||
scope.consoleCm.scrollTo(0, Infinity);
|
scope.consoleCm.scrollTo(0, Infinity);
|
||||||
logCount++;
|
logCount++;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user