Feature request for JavaScript: omit catch
I propose that statements of the form:
try {
// do stuff
}// do more stuff
be valid.
Further I propose that we may emit an argument to throw, e.g.
throw;
try {
// do stuff
}// do more stuff
be valid.
Further I propose that we may emit an argument to throw, e.g.
throw;
8 comments
[ 3.6 ms ] story [ 27.4 ms ] thread(There are other features I wanted in JavaScript too, though, such as getting rid of automatic semicolon insertion, and adding a "goto" command, and adding macros (these three things can all be implemented using a preprocessor, so even if they are not a part of JavaScript, they can still be used). There are also some things that can't easily or efficiently be added other than adding into JavaScript directly, such as new functions for integers such as popcount and ctz and Date.bigNow() and the MOR and MXOR of MMIX. Some things they have already added that I have wanted, such as integers and byte arrays; I am glad that they added those things.)
try {
} catch (err) { }
Omitting (not emitting) an argument to throw would make sense for rethrowing errors in a catch block (many languages already do this), so it may be a good idea.