fix: propagate ownPropertyOnly into Context.spawn() for {% render %} (#893)

Child contexts from spawn() re-derived ownPropertyOnly from Liquid opts
only, dropping per-render RenderOptions overrides. That broke the contract
that parseAndRender(..., { ownPropertyOnly: true }) locks down a single
render, including partials loaded via {% render %}.

Add regression test matching prototype-chain leak PoC.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-05-03 22:35:31 +08:00
committed by GitHub
co-authored by Cursor
parent 26ea2856c7
commit dbbf628803
2 changed files with 23 additions and 1 deletions
+2 -1
View File
@@ -106,7 +106,8 @@ export class Context {
return new Context(scope, this.opts, {
sync: this.sync,
globals: this.globals,
strictVariables: this.strictVariables
strictVariables: this.strictVariables,
ownPropertyOnly: this.ownPropertyOnly
}, {
renderLimit: this.renderLimit,
memoryLimit: this.memoryLimit