mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
* fix: more flexible squared property read expression, fixes #643 * fix: unecessary error wrapping in browser bundles * style: update code style and types * perf: use token.value when evalToken
This commit is contained in:
@@ -454,4 +454,14 @@ describe('Issues', function () {
|
||||
const result = engine.parseAndRenderSync(template, { product })
|
||||
expect(result).toEqual('This is a love potion!')
|
||||
})
|
||||
it('#643 Error When Accessing Subproperty of Bracketed Reference', () => {
|
||||
const engine = new Liquid()
|
||||
const tpl = '{{ ["Key String with Spaces"].subpropertyKey }}'
|
||||
const ctx = {
|
||||
'Key String with Spaces': {
|
||||
subpropertyKey: 'FOO'
|
||||
}
|
||||
}
|
||||
expect(engine.parseAndRenderSync(tpl, ctx)).toEqual('FOO')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user