Prettify the code execution output
This commit is contained in:
@ -38,13 +38,14 @@ window.common = (function(global) {
|
|||||||
codeOutput.setSize('100%', '100%');
|
codeOutput.setSize('100%', '100%');
|
||||||
|
|
||||||
common.updateOutputDisplay = function updateOutputDisplay(str = '') {
|
common.updateOutputDisplay = function updateOutputDisplay(str = '') {
|
||||||
|
if (typeof str !== 'string') {
|
||||||
str = JSON.stringify(str);
|
str = JSON.stringify(str);
|
||||||
|
}
|
||||||
codeOutput.setValue(str);
|
codeOutput.setValue(str);
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
|
|
||||||
common.appendToOutputDisplay = function appendToOutputDisplay(str = '') {
|
common.appendToOutputDisplay = function appendToOutputDisplay(str = '') {
|
||||||
str = JSON.stringify(str);
|
|
||||||
codeOutput.setValue(codeOutput.getValue() + str);
|
codeOutput.setValue(codeOutput.getValue() + str);
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user