fix: memoryLimit doesn't work in for tag, #776

This commit is contained in:
Harttle
2024-12-22 15:46:56 +08:00
parent d61855bf72
commit 2af297f81a
4 changed files with 11 additions and 2 deletions
+5
View File
@@ -524,4 +524,9 @@ describe('Issues', function () {
const result = engine.parseAndRenderSync(`\n{{ "foo" | pos }}`)
expect(result).toEqual('\n[2,12] foo')
})
it("memoryLimit doesn't work in for tag #776", () => {
const engine = new Liquid()
const tpl = `{% for i in (1..1000000000) %} {{'a'}} {% endfor %}`
expect(() => engine.parseAndRenderSync(tpl)).toThrow(/memory out/)
})
})