fix: memory limit issue for join filter, fix #737

This commit is contained in:
Yang Jun
2024-08-23 21:27:53 +08:00
committed by Jun Yang
parent 292a93b738
commit 2d59cff0a6
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import type { Scope } from '../context'
export const join = argumentsToValue(function (this: FilterImpl, v: any[], arg: string) {
const array = toArray(v)
const sep = arg === undefined ? ' ' : arg
const sep = isNil(arg) ? ' ' : stringify(arg)
const complexity = array.length * (1 + sep.length)
this.context.memoryLimit.use(complexity)
return array.join(sep)