I am curious if there is a way to get the name of the reference object from the caught ReferenceError. For example:
try{
foo;
} catch(e){
e.message; // "ReferenceError: foo is not defined"
}
Is there another property containing "foo"? I would like to create something like missing_method in ruby, if possible. Except for variable access, so I'm not worried about losing args / context. This seems to be one of the big blockers.
source
share