MCPcopy Create free account
hub / github.com/breck7/scroll / _singlePassFuse

Method _singlePassFuse

external/.scrollLibs.js:21878–21897  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21876 return await this._fuseRequest
21877 }
21878 async _singlePassFuse() {
21879 const { fileSystem, filePath, codeAtStart } = this
21880 if (codeAtStart !== undefined) {
21881 await this.scrollProgram.appendFromStream(codeAtStart)
21882 } else {
21883 if (!(await fileSystem.exists(filePath))) {
21884 this.exists = false
21885 this.isFused = true
21886 return this
21887 }
21888 this.timestamp = await fileSystem.getCTime(filePath)
21889 const stream = await fileSystem.createReadStream(filePath)
21890 await this.scrollProgram.appendFromStream(stream)
21891 }
21892 this.scrollProgram.wake()
21893 // What happens if we encounter a new parser?
21894 // very frequently if we encounter 1 parser we will encounter a sequence of parsers so
21895 // perhaps on wake, for now, we switch into collecting parsers mode
21896 // and then when we hit a non parser, only at that moment do we recompile the parsers
21897 }
21898}
21899let scrollFileSystemIdNumber = 0
21900class ScrollFileSystem {

Callers 1

singlePassFuseMethod · 0.95

Calls 5

appendFromStreamMethod · 0.80
wakeMethod · 0.80
existsMethod · 0.45
getCTimeMethod · 0.45
createReadStreamMethod · 0.45

Tested by

no test coverage detected