File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
tests/bindings/javascript/res/res Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -203,19 +203,13 @@ $(() => {
203203
204204 fileReader . readAsArrayBuffer ( inputFile ) ;
205205
206- fileReader . onload = async ( ) => {
206+ fileReader . onload = ( ) => {
207207 try {
208- // Retrieve the contents of the file.
209-
210- const fileArrayBuffer = await inputFile . arrayBuffer ( ) ;
211- const memPtr = loc . _malloc ( inputFile . size ) ;
212- const mem = new Uint8Array ( loc . HEAPU8 . buffer , memPtr , inputFile . size ) ;
213-
214- mem . set ( new Uint8Array ( fileArrayBuffer ) ) ;
208+ // Retrieve the contents of the file and pass a Uint8Array to the binding.
215209
216210 file = new loc . File ( inputFile . name ) ;
217211
218- file . setContents ( memPtr , inputFile . size ) ;
212+ file . setContents ( new Uint8Array ( fileReader . result ) ) ;
219213
220214 // Determine the type of the file.
221215
You can’t perform that action at this time.
0 commit comments