Cast()Function
Catches function errors and ensures full compilation
Values
function Cast(fn: callbackFn): mixed
Parameters
- fn
- A callback function to be executed within the Cast() function.
- Has no default value
Returns
- mixed
- Returns the return value of fn or undefined in case of fn returning void.
Example
function randomError() { if (Math.random() > 0.5) { throw Error("big error, very scary"); } } cast(randomError); // Could return: [warn] caught: Error: "big error, very scary"
Notes
- This function is mostly for lazy people like me who can't be bothered to include a try{} and catch{} in every function.
- Also it's probably gonna be the basis of the entirety of JMAC's source from version h or h_b onwards
Log
JMAC g | 27-06-25
Function introduced.