I have code that use ES6 and jQuery Terminal and I want to show error if syntax error happen (in Terminal) which is probably because browser don't support ES6.
I have code like this:
window.onerror = function(message) {
message += '. Your browser may not support ES6.';
var term = $('body');
var args = [].slice.call(arguments);
if (term.hasClass('terminal')) {
$.terminal.active().error(message);
} else {
$('body').terminal(function() {
this.error('You need to use modern browser');
}, {greetings:greetings}).error(message);
}
};
I made syntax error in code I've put <> that simulat syntax error that would happen in IE for var {foo} = bar. But the terminal don't show up and there was no error on screen.