Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
larrywang0701 authored Nov 1, 2023
1 parent d339df8 commit 2b27261
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/bundles/repl/programmable_repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,11 @@ export class ProgrammableRepl {
this.reRenderTab();
return;
}
if (retVal === undefined) {
this.pushOutputString('undefined', COLOR_RUN_CODE_RESULT);
} else if (retVal === null) {
this.pushOutputString('null', COLOR_RUN_CODE_RESULT);
} else {
if (typeof (retVal) === 'string') {
retVal = `"${retVal}"`;
}
// Here must use plain text output mode because retVal contains strings from the users.
this.pushOutputString(retVal, COLOR_RUN_CODE_RESULT);
if (typeof (retVal) === 'string') {
retVal = `"${retVal}"`;
}
// Here must use plain text output mode because retVal contains strings from the users.
this.pushOutputString(retVal, COLOR_RUN_CODE_RESULT);
this.reRenderTab();
developmentLog('RunCode finished');
}
Expand All @@ -81,7 +75,7 @@ export class ProgrammableRepl {
// Rich text output method allow output strings to have html tags and css styles.
pushOutputString(content : string, textColor : string, outputMethod : string = 'plaintext') {
let tmp = {
content,
content: content === undefined ? 'undefined' : content === null ? 'null' : content,
color: textColor,
outputMethod,
};
Expand Down

0 comments on commit 2b27261

Please sign in to comment.