File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 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'
66
77export const join = argumentsToValue ( function ( this : FilterImpl , v : any [ ] , arg : string ) {
88 const array = toArray ( v )
9- const sep = arg === undefined ? ' ' : arg
9+ const sep = isNil ( arg ) ? ' ' : stringify ( arg )
1010 const complexity = array . length * ( 1 + sep . length )
1111 this . context . memoryLimit . use ( complexity )
1212 return array . join ( sep )
Original file line number Diff line number Diff line change @@ -495,4 +495,10 @@ describe('Issues', function () {
495495 const liquid = new Liquid ( )
496496 expect ( ( ) => liquid . parse ( { } as any ) ) . not . toThrow ( )
497497 } )
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+ } )
498504} )
You can’t perform that action at this time.
0 commit comments