function class1(name){
this.name = name;
var _this = this;
process.on('uncaughtException', function (e) {
_this.err(e);
});
}
class1.prototype.func1 = function(){
console.log(this.name);
if(this.name=='aaa')
throw 'error';
};
class1.prototype.err = function(e){
console.log(this.name + e);
};
var c1 = new class1('aaa');
var c2 = new class1('bbb');
c1.func1();
c2.func1();
输出结果 aaa aaaerror bbberror
为什么c2实例也触发了?应该怎么写才会是只触发c1的?