fix: return variable name in include error

This commit is contained in:
Cristofer Gonzales
2020-03-23 23:26:31 +08:00
committed by Jun Yang
parent 6bf242b9fa
commit 93433a8b30
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ export default {
? yield renderer.renderTemplates(liquid.parse(evalQuotedToken(file)), ctx) ? yield renderer.renderTemplates(liquid.parse(evalQuotedToken(file)), ctx)
: yield evalToken(file, ctx)) : yield evalToken(file, ctx))
: file.getText() : file.getText()
assert(filepath, () => `illegal filename "${file}":"${filepath}"`) assert(filepath, () => `illegal filename "${file.getText()}":"${filepath}"`)
const saved = ctx.saveRegister('blocks', 'blockMode') const saved = ctx.saveRegister('blocks', 'blockMode')
ctx.setRegister('blocks', {}) ctx.setRegister('blocks', {})
+1 -1
View File
@@ -44,7 +44,7 @@ describe('tags/include', function () {
}) })
return liquid.renderFile('/parent.html').catch(function (e) { return liquid.renderFile('/parent.html').catch(function (e) {
expect(e.name).to.equal('RenderError') expect(e.name).to.equal('RenderError')
expect(e.message).to.match(/illegal filename/) expect(e.message).to.match(/illegal filename "not-exist"/)
}) })
}) })