mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-17 13:20:41 -07:00
feat: allow drops in property access (#769)
This commit is contained in:
@@ -50,6 +50,16 @@ describe('Expression', function () {
|
||||
expect(await toPromise(create('foo[doo["foo"]]').evaluate(ctx, false))).toBe('BAR')
|
||||
expect(await toPromise(create('doo[coo].foo').evaluate(ctx, false))).toBe('bar')
|
||||
})
|
||||
it('should support drops in property access', async function () {
|
||||
class TemplateDrop extends Drop {
|
||||
valueOf () { return 'bar' }
|
||||
}
|
||||
const ctx = new Context({
|
||||
foo: { bar: 'BAR' },
|
||||
coo: new TemplateDrop()
|
||||
})
|
||||
expect(await toPromise(create('foo[coo]').evaluate(ctx, false))).toBe('BAR')
|
||||
})
|
||||
})
|
||||
|
||||
describe('simple expression', function () {
|
||||
|
||||
Reference in New Issue
Block a user