Fix TokenOrIdentifierObject.getText() crash (#19673)
TokenOrIdentifierObject.getText() needs to pass `sourceFile` as an argument to `getStart()`. Fixes https://github.com/Microsoft/TypeScript/issues/19670
This commit is contained in:
parent
ba98cbbf92
commit
1a7a587a9e
|
@ -276,7 +276,10 @@ namespace ts {
|
|||
}
|
||||
|
||||
public getText(sourceFile?: SourceFile): string {
|
||||
return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd());
|
||||
if (!sourceFile) {
|
||||
sourceFile = this.getSourceFile();
|
||||
}
|
||||
return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd());
|
||||
}
|
||||
|
||||
public getChildCount(): number {
|
||||
|
|
Loading…
Reference in a new issue