@@ -200,7 +200,7 @@ class Blob {
200
200
const length = this [ kLength ] ;
201
201
return {
202
202
data : { handle, type, length } ,
203
- deserializeInfo : 'internal/blob:ClonedBlob ' ,
203
+ deserializeInfo : 'internal/blob:CloneableBlob ' ,
204
204
} ;
205
205
}
206
206
@@ -397,25 +397,27 @@ class Blob {
397
397
}
398
398
}
399
399
400
- function ClonedBlob ( ) {
401
- return ReflectConstruct ( function ( ) {
400
+ class CloneableBlob extends Blob {
401
+ static {
402
402
markTransferMode ( this , true , false ) ;
403
- } , [ ] , Blob ) ;
403
+ this [ kDeserialize ] = ( ) => { } ;
404
+ }
404
405
}
405
- ClonedBlob . prototype [ kDeserialize ] = ( ) => { } ;
406
406
407
- function TransferrableBlob ( handle , length , type = '' ) {
407
+ CloneableBlob . prototype . constructor = Blob ;
408
+
409
+ function TransferableBlob ( handle , length , type = '' ) {
408
410
markTransferMode ( this , true , false ) ;
409
411
this [ kHandle ] = handle ;
410
412
this [ kType ] = type ;
411
413
this [ kLength ] = length ;
412
414
}
413
415
414
- ObjectSetPrototypeOf ( TransferrableBlob . prototype , Blob . prototype ) ;
415
- ObjectSetPrototypeOf ( TransferrableBlob , Blob ) ;
416
+ ObjectSetPrototypeOf ( TransferableBlob . prototype , Blob . prototype ) ;
417
+ ObjectSetPrototypeOf ( TransferableBlob , Blob ) ;
416
418
417
419
function createBlob ( handle , length , type = '' ) {
418
- const transferredBlob = new TransferrableBlob ( handle , length , type ) ;
420
+ const transferredBlob = new TransferableBlob ( handle , length , type ) ;
419
421
420
422
// Fix issues like: https://github.com/nodejs/node/pull/49730#discussion_r1331720053
421
423
transferredBlob . constructor = Blob ;
@@ -489,7 +491,7 @@ function createBlobFromFilePath(path, options) {
489
491
490
492
module . exports = {
491
493
Blob,
492
- ClonedBlob ,
494
+ CloneableBlob ,
493
495
createBlob,
494
496
createBlobFromFilePath,
495
497
isBlob,
0 commit comments