Merge pull request #6119 from bugron/fix/better-output

Prettify the code execution output
This commit is contained in:
Logan Tegman
2016-01-13 06:48:41 -08:00

View File

@ -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 = '') {
str = JSON.stringify(str); if (typeof str !== 'string') {
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;
}; };