File tree Expand file tree Collapse file tree
_packages/native-preview/src/api/node Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ export class RemoteSourceFile extends RemoteNode implements SourceFileInfo {
4545 readonly _offsetExtendedData : number ;
4646 readonly _offsetStructuredData : number ;
4747 readonly _decoder : TextDecoder ;
48+ private _cachedText : string | undefined ;
4849
4950 constructor ( data : Uint8Array , decoder : TextDecoder ) {
5051 const view = new DataView ( data . buffer , data . byteOffset , data . byteLength ) ;
@@ -198,6 +199,13 @@ export class RemoteSourceFile extends RemoteNode implements SourceFileInfo {
198199 get isDeclarationFile ( ) : boolean {
199200 return ( this . flags & NodeFlags . Ambient ) !== 0 ;
200201 }
202+
203+ get text ( ) : string {
204+ if ( this . _cachedText !== undefined ) return this . _cachedText ;
205+ const text = super . text ! ;
206+ this . _cachedText = text ;
207+ return text ;
208+ }
201209}
202210
203211/**
You can’t perform that action at this time.
0 commit comments