try{ b();//调用b方法}catch{//当b方法运行错误,直接中断循环。 break;}
void A(){ try { while(1==1) { B(); } } catch(e) { } //循环外的代码}