Extending Error is flaky because `Error.call` returns a new object
Open
bug
- Dominant language
- JavaScript
- Stars
- 874
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
I.e. `let x = {}; Error.call(x) == x` produces false, at least on Firefox and Chrome. This is preventing Error subclasses compiled with Bublé from getting `stack` and `message` properties, making them rather useless.
Babel works around this by creating a new binding to replace `this` inside the constructor, storing the result of the super constructor call in that, and returning it at the end. Would that be something that Bublé would be interested in adding? I might be able to create a PR.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.