@@ -49,7 +49,7 @@ const bufferSourceChunksForDeflate = [
4949 } ,
5050 {
5151 name : 'Float16Array' ,
52- value : new Float16Array ( new Uint8Array ( compressedBytesWithDeflate ) . buffer )
52+ value : ( ) => new Float16Array ( new Uint8Array ( compressedBytesWithDeflate ) . buffer )
5353 } ,
5454 {
5555 name : 'Float32Array' ,
@@ -100,7 +100,7 @@ const bufferSourceChunksForGzip = [
100100 } ,
101101 {
102102 name : 'Float16Array' ,
103- value : new Float16Array ( new Uint8Array ( compressedBytesWithGzip ) . buffer )
103+ value : ( ) => new Float16Array ( new Uint8Array ( compressedBytesWithGzip ) . buffer )
104104 } ,
105105 {
106106 name : 'Float32Array' ,
@@ -151,7 +151,7 @@ const bufferSourceChunksForDeflateRaw = [
151151 } ,
152152 {
153153 name : 'Float16Array' ,
154- value : new Float16Array ( new Uint8Array ( compressedBytesWithDeflateRaw ) . buffer )
154+ value : ( ) => new Float16Array ( new Uint8Array ( compressedBytesWithDeflateRaw ) . buffer )
155155 } ,
156156 {
157157 name : 'Float32Array' ,
@@ -172,7 +172,7 @@ for (const chunk of bufferSourceChunksForDeflate) {
172172 const ds = new DecompressionStream ( 'deflate' ) ;
173173 const reader = ds . readable . getReader ( ) ;
174174 const writer = ds . writable . getWriter ( ) ;
175- const writePromise = writer . write ( chunk . value ) ;
175+ const writePromise = writer . write ( typeof chunk . value === 'function' ? chunk . value ( ) : chunk . value ) ;
176176 writer . close ( ) ;
177177 const { value } = await reader . read ( ) ;
178178 assert_array_equals ( Array . from ( value ) , deflateExpectedChunkValue , 'value should match' ) ;
@@ -184,7 +184,7 @@ for (const chunk of bufferSourceChunksForGzip) {
184184 const ds = new DecompressionStream ( 'gzip' ) ;
185185 const reader = ds . readable . getReader ( ) ;
186186 const writer = ds . writable . getWriter ( ) ;
187- const writePromise = writer . write ( chunk . value ) ;
187+ const writePromise = writer . write ( typeof chunk . value === 'function' ? chunk . value ( ) : chunk . value ) ;
188188 writer . close ( ) ;
189189 const { value } = await reader . read ( ) ;
190190 assert_array_equals ( Array . from ( value ) , gzipExpectedChunkValue , 'value should match' ) ;
@@ -196,7 +196,7 @@ for (const chunk of bufferSourceChunksForDeflateRaw) {
196196 const ds = new DecompressionStream ( 'deflate-raw' ) ;
197197 const reader = ds . readable . getReader ( ) ;
198198 const writer = ds . writable . getWriter ( ) ;
199- const writePromise = writer . write ( chunk . value ) ;
199+ const writePromise = writer . write ( typeof chunk . value === 'function' ? chunk . value ( ) : chunk . value ) ;
200200 writer . close ( ) ;
201201 const { value } = await reader . read ( ) ;
202202 assert_array_equals ( Array . from ( value ) , deflateRawExpectedChunkValue , 'value should match' ) ;
0 commit comments