test: cover readSize branches in Context

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-07-24 00:49:10 +08:00
co-authored by Cursor
parent 6f8224d286
commit e8d5487a43
2 changed files with 13 additions and 0 deletions
@@ -27,6 +27,12 @@ describe('scope security', function () {
await expect(liquid.parseAndRender('{{ obj.size }}', { obj })).resolves.toBe('1')
})
it('should read inherited size when ownPropertyOnly=false', async function () {
liquid = new Liquid({ ownPropertyOnly: false })
const obj = Object.create({ size: 99 })
await expect(liquid.parseAndRender('{{ obj.size }}', { obj })).resolves.toBe('99')
})
it('should still iterate Drop with Symbol.iterator', async function () {
class IterableDrop extends Drop {
* [Symbol.iterator] () {