関数を try-catch ブロック内にラップすることは可能ですか? 最初の関数では機能しないように見えますが、そのように宣言されたプロトタイプ関数では機能しますか?
例:
try {
function MyFunction1() {
//function code here
}
MyFunction1.prototype.getValue = function() {
//more code here
}
} catch (e) {
//error handling here
}