pref: remove await/async from internal async calls

This commit is contained in:
harttle
2019-10-26 08:57:33 -05:00
committed by Jun Yang
parent d4ad4b8a8c
commit b82fa9ed2b
40 changed files with 416 additions and 380 deletions
+3 -10
View File
@@ -47,17 +47,10 @@ export class Value {
}
this.filters.push(new Filter(name, args, this.strictFilters))
}
public async value (ctx: Context) {
let val = await new Expression(this.initial).evaluate(ctx)
public * value (ctx: Context) {
let val = yield new Expression(this.initial).evaluate(ctx)
for (const filter of this.filters) {
val = await filter.render(val, ctx)
}
return val
}
public valueSync (ctx: Context) {
let val = new Expression(this.initial).evaluateSync(ctx)
for (const filter of this.filters) {
val = filter.renderSync(val, ctx)
val = yield filter.render(val, ctx)
}
return val
}