try {
setTimeout(function() {
throw 'ex';//这里的ex是catch不到的
}, 0);
} catch(e) {
console.info('exception CAUGHT');// never goes here
}try 只管当前作用域的吗?
setTimeout(function() {
throw 'ex';//这里的ex是catch不到的
}, 0);
} catch(e) {
console.info('exception CAUGHT');// never goes here
}try 只管当前作用域的吗?
try {
throw 'ex';//这里的ex是catch不到的
} catch(e) {
console.info('exception CAUGHT');// never goes here
}
}, 0);要在同一个线程才能捕获异常