mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
feat(context): null-prototype scope frames via createScope (#899)
- Add createScope() building Object.create(null) with optional own props - Initialize context stack bottom with createScope() for assign/capture - Push null-proto scopes from for, tablerow, block, layout, include (incl. Jekyll) Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -2,7 +2,7 @@ import { getPerformance } from '../util/performance'
|
||||
import { Drop } from '../drop/drop'
|
||||
import { __assign } from 'tslib'
|
||||
import { NormalizedFullOptions, defaultOptions, RenderOptions } from '../liquid-options'
|
||||
import { Scope } from './scope'
|
||||
import { createScope, Scope } from './scope'
|
||||
import { hasOwnProperty, isArray, isNil, isUndefined, isString, isFunction, toLiquid, InternalUndefinedVariableError, toValueSync, isObject, Limiter, toValue } from '../util'
|
||||
|
||||
type PropertyKey = string | number;
|
||||
@@ -12,7 +12,7 @@ export class Context {
|
||||
* insert a Context-level empty scope,
|
||||
* for tags like `{% capture %}` `{% assign %}` to operate
|
||||
*/
|
||||
private scopes: Scope[] = [{}]
|
||||
private scopes: Scope[] = [createScope()]
|
||||
private registers = {}
|
||||
/**
|
||||
* user passed in scope
|
||||
|
||||
Reference in New Issue
Block a user