File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -817,7 +817,7 @@ class FdEntry final : public EntryImpl {
817
817
uint64_t new_start = start_ + start;
818
818
uint64_t new_end = end_;
819
819
if (end.has_value ()) {
820
- new_end = std::min (end.value () + start, new_end );
820
+ new_end = std::min (end.value (), end_ - start_ );
821
821
}
822
822
823
823
CHECK (new_start >= start_);
@@ -881,7 +881,7 @@ class FdEntry final : public EntryImpl {
881
881
file,
882
882
Local<Object>(),
883
883
entry->start_ ,
884
- entry->end_ )),
884
+ entry->end_ - entry-> start_ )),
885
885
entry);
886
886
}
887
887
Original file line number Diff line number Diff line change @@ -67,6 +67,14 @@ writeFileSync(testfile3, '');
67
67
await unlink ( testfile ) ;
68
68
} ) ( ) . then ( common . mustCall ( ) ) ;
69
69
70
+ ( async ( ) => {
71
+ // Refs: https://github.com/nodejs/node/issues/47683
72
+ const blob = await openAsBlob ( testfile ) ;
73
+ const res = blob . slice ( 10 , 20 ) ;
74
+ const data = await res . arrayBuffer ( ) ;
75
+ strictEqual ( res . size , data . byteLength ) ;
76
+ } ) ( ) . then ( common . mustCall ( ) ) ;
77
+
70
78
( async ( ) => {
71
79
const blob = await openAsBlob ( testfile2 ) ;
72
80
const stream = blob . stream ( ) ;
You can’t perform that action at this time.
0 commit comments