fix: execute js/py code (#129)

This commit is contained in:
sigoden
2024-11-25 08:21:58 +08:00
committed by GitHub
parent 4e0c6e752d
commit ecf7233401
2 changed files with 28 additions and 8 deletions
+5 -2
View File
@@ -12,8 +12,11 @@ exports.run = function run({ code }) {
if (callback) callback();
};
eval(code);
const value = eval(code);
if (value !== undefined) {
output += value;
}
process.stdout.write = oldStdoutWrite;
return output;
}