mirror of
https://github.com/swc-project/swc.git
synced 2024-12-19 03:31:45 +03:00
6 lines
214 B
TypeScript
6 lines
214 B
TypeScript
class CustomError extends Error {
|
|
constructor(message?: string) {
|
|
super(message); // 'Error' breaks prototype chain here
|
|
Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain
|
|
}
|
|
} |