My suggestion is to allow return
in try...catch
statements, such that this code:
/** @type { User | false } */
let user
try {
user = getUser()
} catch (e) {
user = false
}
can be replaced by this one:
const user = try {
return getUser()
} catch(e) {
return false
}
The braces could be made optional, which would mean an implicit return
(as for arrow functions):
const user = try getUser() catch(e) false
the try...catch
blocks therefore become statements, but I don't think this will be a problem with older code.