Prettify the code execution output

This commit is contained in:
Arsen Melikyan
2016-01-13 13:17:30 +04:00
parent 5a1ef2f957
commit d502b35bac

View File

@ -38,13 +38,14 @@ window.common = (function(global) {
codeOutput.setSize('100%', '100%');
common.updateOutputDisplay = function updateOutputDisplay(str = '') {
str = JSON.stringify(str);
if (typeof str !== 'string') {
str = JSON.stringify(str);
}
codeOutput.setValue(str);
return str;
};
common.appendToOutputDisplay = function appendToOutputDisplay(str = '') {
str = JSON.stringify(str);
codeOutput.setValue(codeOutput.getValue() + str);
return str;
};