This commit is contained in:
Chayapak 2023-08-18 07:09:44 +07:00
parent 651076d6bd
commit 342e21a229

View file

@ -68,6 +68,7 @@ io.on('connection', (socket) => {
resetVM() resetVM()
socket.on('runCode', (transactionId, code) => { socket.on('runCode', (transactionId, code) => {
(async () => {
try { try {
const output = vm.run(code) const output = vm.run(code)
@ -75,6 +76,7 @@ io.on('connection', (socket) => {
} catch (e) { } catch (e) {
socket.emit('codeOutput', transactionId, true, e.toString()) socket.emit('codeOutput', transactionId, true, e.toString())
} }
})()
}) })
socket.on('reset', resetVM) socket.on('reset', resetVM)