We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e78e783 commit c31a76eCopy full SHA for c31a76e
src/Decoder.ts
@@ -64,10 +64,14 @@ export class DecodeError extends Error {
64
constructor(message: string) {
65
super(message);
66
67
+ // fix the prototype chain in a cross-platform way
68
+ const proto = Object.create(DecodeError.prototype);
69
+ Object.setPrototypeOf(this, proto);
70
+
71
Object.defineProperty(this, "name", {
72
configurable: true,
73
enumerable: false,
- value: this.constructor.name,
74
+ value: DecodeError.name,
75
});
76
}
77
0 commit comments