mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
refactor: remove createScope helper
Drop the exported helper and finish migrating call sites. Revert incidental context/for/include/layout churn so behavior matches mainline aside from the removal. Trim duplicate e2e and heavy Object.prototype loops in registry tests. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -77,22 +77,6 @@ describe('Issues', function () {
|
||||
)
|
||||
expect(html).toBe('BAR')
|
||||
})
|
||||
it('filter/tag maps are null-prototype (node + UMD)', async () => {
|
||||
const nodeEngine = new Liquid()
|
||||
const umdEngine = new LiquidUMD()
|
||||
expect(Object.getPrototypeOf(nodeEngine.filters)).toBeNull()
|
||||
expect(Object.getPrototypeOf(nodeEngine.tags)).toBeNull()
|
||||
expect(Object.getPrototypeOf(umdEngine.filters)).toBeNull()
|
||||
expect(Object.getPrototypeOf(umdEngine.tags)).toBeNull()
|
||||
})
|
||||
it('filter/tag lookups ignore Object.prototype keys unless registered (node + UMD)', async () => {
|
||||
for (const LiquidClass of [Liquid, LiquidUMD]) {
|
||||
const engine = new LiquidClass()
|
||||
await expect(engine.parseAndRender('{{ x | constructor }}', { x: 'OK' })).resolves.toBe('OK')
|
||||
await expect(new LiquidClass({ strictFilters: true }).parseAndRender('{{ x | constructor }}', { x: 'OK' })).rejects.toThrow(/undefined filter/)
|
||||
expect(() => engine.parse('{% constructor %}')).toThrow('tag "constructor" not found')
|
||||
}
|
||||
})
|
||||
it('lenientIf not working as expected in umd #313', async () => {
|
||||
const engine = new LiquidUMD({
|
||||
strictVariables: true,
|
||||
|
||||
Reference in New Issue
Block a user