File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,9 @@ export class ResultError extends Error {
6
6
isHtml : boolean ;
7
7
override name = "ArrayResultError" ;
8
8
constructor ( message : string , options : Partial < ResultErrorOptions > = { } ) {
9
- super ( message , { cause : options . cause } ) ;
10
- this . isHtml = options . isHtml ?? false ;
9
+ const { cause, isHtml = false } = options ;
10
+ super ( message , { cause } ) ;
11
+ this . isHtml = isHtml ;
11
12
}
12
13
}
13
14
export class TodoError extends ResultError {
Original file line number Diff line number Diff line change @@ -87,11 +87,9 @@ export class Parser<T> {
87
87
}
88
88
export type Position = Readonly < { position : number ; length : number } > ;
89
89
export class PositionedError extends ResultError {
90
- public position : null | Position ;
91
90
override name = "PositionedError" ;
92
- constructor ( message : string , position ?: Position ) {
91
+ constructor ( message : string , public readonly position : null | Position = null ) {
93
92
super ( message ) ;
94
- this . position = position ?? null ;
95
93
}
96
94
}
97
95
function withPositionedError < T > ( fn : ( ) => T , position : Position ) {
You can’t perform that action at this time.
0 commit comments