In normal Javascript in the Browser Google Chrome will display an error in the console when you try to use an undefined variable. However in Node.js no error is displayed and I think the function that is using the undefined variable exits.
I've added:
process.on('uncaughtException', function(err) {
console.log( 'uncaughtException :', err );
});
but this isn't executed.
I've also added try-catch in the calling function and no exception is raised there.
And I'm using: "use strict";
So my question is, is there some way I can get/see an error when an undefined variable is accessed?
"use strict";. The expected behaviour is that node exits, logging this message to the console. Do you have any other relevant code?