Skip to content

Commit

Permalink
fix: bugs transform CanadaHonk#94
Browse files Browse the repository at this point in the history
  • Loading branch information
yazaldefilimone committed Jul 16, 2024
1 parent 340e54a commit 9e51e11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runner/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const memoryToString = mem => {
let prev = '';

function setLastEvalExp(prev, ret) {
const lastEvalExp = `let _ = ${ret != null ? ret : "undefined"};\n`;
const lastEvalExp = `let _ = ${JSON.stringify(ret)};\n`;
if (/let _ = .*;\n/.test(prev)) {
return prev.replace(/let _ = .*;\n/, lastEvalExp);
}
Expand Down Expand Up @@ -119,7 +119,7 @@ const run = (source, _context, _filename, callback, run = true) => {

// callback(null, ret);

prev = setLastEvalExp( prev + ';\n' + source.trim(), ret);
prev = setLastEvalExp(prev + ';\n' + source.trim(), ret);

callback();
};
Expand Down

0 comments on commit 9e51e11

Please sign in to comment.