andrezsanchez / custom-error

(UNMAINTAINED) Create custom errors in JavaScript that inherit Error or descendants of Error
MIT License
24 stars 5 forks source link

Update index.js #4

Closed alsotang closed 8 years ago

andrezsanchez commented 8 years ago

What is this trying to fix? err.name = name was written so that certain browsers return the stack trace correctly, as the preceding comment suggests (though perhaps a bit too vaguely). I suppose I should get around to adding browser tests so that this is obvious.

alsotang commented 8 years ago

oh.. because I find err var not used any more after the assign. maybe it's a trick here. I should close this pr...sorry

andrezsanchez commented 8 years ago

It's fine, yes it is a bit odd. That line affects the value of err.stack, so it does in fact have an effect.

alsotang commented 8 years ago

alright, this line is somehow tricky. thx for explaintion

2015-11-16 19:31 GMT+08:00 Andre Z Sanchez notifications@github.com:

It's fine, yes it is a bit odd. That line affects the value of err.stack, so it does in fact have an effect.

— Reply to this email directly or view it on GitHub https://github.com/andrezsanchez/custom-error/pull/4#issuecomment-157003251 .