File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import type { Scope } from '../context'
6
6
7
7
export const join = argumentsToValue ( function ( this : FilterImpl , v : any [ ] , arg : string ) {
8
8
const array = toArray ( v )
9
- const sep = arg === undefined ? ' ' : arg
9
+ const sep = isNil ( arg ) ? ' ' : stringify ( arg )
10
10
const complexity = array . length * ( 1 + sep . length )
11
11
this . context . memoryLimit . use ( complexity )
12
12
return array . join ( sep )
Original file line number Diff line number Diff line change @@ -495,4 +495,10 @@ describe('Issues', function () {
495
495
const liquid = new Liquid ( )
496
496
expect ( ( ) => liquid . parse ( { } as any ) ) . not . toThrow ( )
497
497
} )
498
+ it ( 'Unexpected "RenderError: memory alloc limit exceeded" #737' , ( ) => {
499
+ const liquid = new Liquid ( ) ;
500
+ const context = { x : [ "a" , "b" ] } ;
501
+ const template = "{{ x | join: 5 }}"
502
+ expect ( liquid . parseAndRender ( template , context ) ) . resolves . toEqual ( 'a5b' )
503
+ } )
498
504
} )
You can’t perform that action at this time.
0 commit comments