→
| Error | Error。 |
|---|
try{
E=new Error('Could not parse input');
throw E;
}catch(e){
alert(e.description); //表示:undefined
}
try{
Obj=Test;
}catch(e){
alert(e.message); //表示:Test is not defined
alert(e.description); //表示:undefined。¶descriptionは使われていないようだ
}
try{
E=new Error('エラー発生');
E.description="説明です";
throw E;
}catch(e){
alert(e.message); //表示:エラー発生
alert(e.description); //表示:説明です
}