mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
refactor: switch Context <-> Scope concepts
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { evalExp } from '../render/syntax'
|
||||
import { FilterArgs, Filter } from './filter/filter'
|
||||
import Scope from '../scope/scope'
|
||||
import Context from '../context/context'
|
||||
|
||||
export default class Value {
|
||||
private strictFilters: boolean
|
||||
@@ -47,10 +47,10 @@ export default class Value {
|
||||
}
|
||||
this.filters.push(new Filter(name, args, this.strictFilters))
|
||||
}
|
||||
async value (scope: Scope) {
|
||||
let val = await evalExp(this.initial, scope)
|
||||
async value (ctx: Context) {
|
||||
let val = await evalExp(this.initial, ctx)
|
||||
for (const filter of this.filters) {
|
||||
val = await filter.render(val, scope)
|
||||
val = await filter.render(val, ctx)
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user