This PR adds support for the throw keyword. It proxies to the unreachable instruction in the WebAssembly spec. As per spec nothing can be actually "thrown" with the runtime exception.
function test() {
throw;
}
The syntax does reserve an expression after the throw keyword for future use so this code is also valid, although the expression is ignored after the throw.
function test() {
// May throw the result of expression in the future if WebAssembly supports it
throw somefunction(2 + 2, another());
}
New Feature
This PR adds support for the
throw
keyword. It proxies to theunreachable
instruction in the WebAssembly spec. As per spec nothing can be actually "thrown" with the runtime exception.The syntax does reserve an expression after the
throw
keyword for future use so this code is also valid, although the expression is ignored after the throw.