mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
feat: ownPropertyOnly option to protect prototype, #454
This commit is contained in:
@@ -194,4 +194,9 @@ describe('Issues', function () {
|
||||
const html = engine.parseAndRenderSync(template, { array: [1, 2, 3] })
|
||||
expect(html).to.equal('4#8#12#6')
|
||||
})
|
||||
it('#454 leaking JS prototype getter functions in evaluation', async () => {
|
||||
const engine = new Liquid({ ownPropertyOnly: true })
|
||||
const html = engine.parseAndRenderSync('{{foo | size}}-{{bar.coo}}', { foo: 'foo', bar: Object.create({ coo: 'COO' }) })
|
||||
expect(html).to.equal('3-')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user