Skip to content

Commit

Permalink
Always properly throw VMError
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Jul 23, 2018
1 parent 4bbdf55 commit 4623380
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/runCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ module.exports = function (opts, cb) {
if (result !== undefined) {
if (retNum !== 1) {
// opcode post-stack mismatch
return cb(VmError(ERROR.INTERNAL_ERROR))
return cb(new VmError(ERROR.INTERNAL_ERROR))
}

runState.stack.push(result)
} else {
if (!opInfo.async && retNum !== 0) {
// opcode post-stack mismatch
return cb(VmError(ERROR.INTERNAL_ERROR))
return cb(new VmError(ERROR.INTERNAL_ERROR))
}
}

Expand Down

0 comments on commit 4623380

Please sign in to comment.