perf: add cross-engines benchmark

This commit is contained in:
harttle
2021-06-20 13:25:08 +08:00
committed by Jun Yang
parent cc9b28307c
commit cdceb25d00
28 changed files with 32097 additions and 1585 deletions
+2 -2
View File
@@ -7,12 +7,12 @@ import { stringify } from '../../util/underscore'
import { assert } from '../../util/assert'
export function append (v: string, arg: string) {
assert(arg !== undefined, () => 'append expect 2 arguments')
assert(arguments.length === 2, () => 'append expect 2 arguments')
return stringify(v) + stringify(arg)
}
export function prepend (v: string, arg: string) {
assert(arg !== undefined, () => 'prepend expect 2 arguments')
assert(arguments.length === 2, () => 'prepend expect 2 arguments')
return stringify(arg) + stringify(v)
}
+1
View File
@@ -24,6 +24,7 @@ export default {
render: function * (ctx: Context, emitter: Emitter) {
const { liquid, hash, withVar, file } = this
const { renderer } = liquid
// TODO try move all liquid.parse calls into parse() section
const filepath = ctx.opts.dynamicPartials
? (TypeGuards.isQuotedToken(file)
? yield renderer.renderTemplates(liquid.parse(evalQuotedToken(file)), ctx)