File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/compiler-cli/src/ngtsc/diagnostics/src Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ export class FatalDiagnosticError extends Error {
1717 readonly diagnosticMessage : string | ts . DiagnosticMessageChain ,
1818 readonly relatedInformation ?: ts . DiagnosticRelatedInformation [ ] ) {
1919 super ( `FatalDiagnosticError #${ code } : ${ diagnosticMessage } ` ) ;
20+
21+ // Extending `Error` ends up breaking some internal tests. This appears to be a known issue
22+ // when extending errors in TS and the workaround is to explicitly set the prototype.
23+ // https://stackoverflow.com/questions/41102060/typescript-extending-error-class
24+ Object . setPrototypeOf ( this , new . target . prototype ) ;
2025 }
2126
2227 // Trying to hide `.message` from `Error` to encourage users to look
You can’t perform that action at this time.
0 commit comments