fix: allow {%render%} to reassign argument, #404

This commit is contained in:
AleksandrHovhannisyan
2021-10-31 16:28:33 +08:00
committed by Harttle
parent 432d1c7ccb
commit 124f4c4485
9 changed files with 44 additions and 6 deletions
+12
View File
@@ -6,9 +6,21 @@ import { isArray, isNil, isString, isFunction, toLiquid } from '../util/undersco
import { InternalUndefinedVariableError } from '../util/error'
export class Context {
/**
* insert a Context-level empty scope,
* for tags like {% capture %} {% assign %} to operate
*/
private scopes: Scope[] = [{}]
private registers = {}
/**
* user passed in scope
* {% increment %}, {% decrement %} changes this scope,
* whereas {% capture %}, {% assign %} only hide this scope
*/
public environments: Scope
/**
* global scope used as fallback for missing variables
*/
public globals: Scope
public sync: boolean
public opts: NormalizedFullOptions