Skip to content

Commit

Permalink
Use public instance class field for name property (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Mar 20, 2022
1 parent 858c046 commit 88a95be
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.js
@@ -1,12 +1,8 @@
export class NonError extends Error {
name = 'NonError';

constructor(message) {
super(NonError._prepareSuperMessage(message));

Object.defineProperty(this, 'name', {
value: 'NonError',
configurable: true,
writable: true,
});
}

static _prepareSuperMessage(message) {
Expand Down

0 comments on commit 88a95be

Please sign in to comment.