promise ( i don't think does anything?)

This commit is contained in:
Chayapak 2024-10-19 17:59:11 +07:00
parent 403a9613b6
commit 6df2ef5f0c

View file

@ -71,13 +71,15 @@ io.on('connection', async (socket) => {
resetVM()
socket.on('runCode', async (transactionId, code) => {
try {
const output = vm.run(code)
new Promise(() => {
try {
const output = vm.run(code)
socket.emit('codeOutput', transactionId, false, util.inspect(output, { stylize }))
} catch (e) {
socket.emit('codeOutput', transactionId, true, e.toString())
}
socket.emit('codeOutput', transactionId, false, util.inspect(output, { stylize }))
} catch (e) {
socket.emit('codeOutput', transactionId, true, e.toString())
}
})
})
socket.on('reset', resetVM)