Actionscript supports multiple catch blocks, javascript does not.
try {
//something
} catch(error:ReferenceError) {
//doStuff
} catch(error:TypeError) {
//doOtherStuff
} //otherwise if it is neither of the above it will not be caught.
The above currently generates invalid javascript code (Syntax error).
It should be rewritten in js something more like:
try {
//something
} catch(error:Error) {
if (error is ReferenceError) {
//doStuff
} else (if error is TypeError) {
//doOtherStuff
} else {
//otherwise if it is neither of the above it will not be caught.
throw error;
}
}
Apparently other "Typed Language"-to-JS solutions already do this type of thing. Needs investigation and fixes in compiler-jx.
Actionscript supports multiple catch blocks, javascript does not.
The above currently generates invalid javascript code (Syntax error).
It should be rewritten in js something more like:
Apparently other "Typed Language"-to-JS solutions already do this type of thing. Needs investigation and fixes in compiler-jx.