From 4b079c54b15737d2ce07938adfad24c526473c3b Mon Sep 17 00:00:00 2001 From: tgrandgent Date: Fri, 3 Jan 2020 15:52:21 -0500 Subject: [PATCH] fix: add `this` to fs references in parseFile --- src/liquid.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/liquid.ts b/src/liquid.ts index 00d7196850..89c96a9a39 100644 --- a/src/liquid.ts +++ b/src/liquid.ts @@ -67,15 +67,15 @@ export class Liquid { public * _parseFile (file: string, opts?: LiquidOptions, sync?: boolean) { const options = { ...this.options, ...normalize(opts) } const paths = options.root.map(root => this.fs.resolve(root, file, options.extname)) - if (fs.fallback !== undefined) { - const filepath = fs.fallback(file) + if (this.fs.fallback !== undefined) { + const filepath = this.fs.fallback(file) if (filepath !== undefined) paths.push(filepath) } for (const filepath of paths) { if (this.options.cache && this.cache[filepath]) return this.cache[filepath] if (!(sync ? this.fs.existsSync(filepath) : yield this.fs.exists(filepath))) continue - const tpl = this.parse(sync ? fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath) + const tpl = this.parse(sync ? this.fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath) return (this.cache[filepath] = tpl) } throw this.lookupError(file, options.root)