File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ const {
69
69
CountQueuingStrategy,
70
70
} = require ( 'internal/webstreams/queuingstrategies' ) ;
71
71
72
+ const { queueMicrotask } = require ( 'internal/process/task_queues' ) ;
73
+
72
74
const kHandle = Symbol ( 'kHandle' ) ;
73
75
const kType = Symbol ( 'kType' ) ;
74
76
const kLength = Symbol ( 'kLength' ) ;
@@ -284,7 +286,7 @@ class Blob {
284
286
}
285
287
if ( buffer !== undefined )
286
288
buffers . push ( buffer ) ;
287
- readNext ( ) ;
289
+ queueMicrotask ( ( ) => readNext ( ) ) ;
288
290
} ) ;
289
291
} ;
290
292
readNext ( ) ;
Original file line number Diff line number Diff line change @@ -315,3 +315,16 @@ assert.throws(() => new Blob({}), {
315
315
316
316
delete Object . prototype . type ;
317
317
}
318
+
319
+ ( async ( ) => {
320
+ // Refs: https://github.com/nodejs/node/issues/47301
321
+
322
+ const random = Buffer . alloc ( 256 ) . fill ( '0' ) ;
323
+ const chunks = [ ] ;
324
+
325
+ for ( let i = 0 ; i < random . length ; i += 2 ) {
326
+ chunks . push ( random . subarray ( i , i + 2 ) ) ;
327
+ }
328
+
329
+ await new Blob ( chunks ) . arrayBuffer ( ) ;
330
+ } ) ( ) . then ( common . mustCall ( ) ) ;
You can’t perform that action at this time.
0 commit comments