Closed alsotang closed 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
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.
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 .
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.