A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nodejs/node/commit/ca6854443d below:

fix slice of slice of file-backed Blob · nodejs/node@ca68544 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+14

-2

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+14

-2

lines changed Original file line number Diff line number Diff line change

@@ -840,7 +840,9 @@ class FdEntry final : public EntryImpl {

840 840

path_(std::move(path_)),

841 841

stat_(stat),

842 842

start_(start),

843 -

end_(end) {}

843 +

end_(end) {

844 +

CHECK_LE(start, end);

845 +

}

844 846 845 847

std::shared_ptr<DataQueue::Reader> get_reader() override {

846 848

return ReaderImpl::Create(this);

@@ -851,7 +853,7 @@ class FdEntry final : public EntryImpl {

851 853

uint64_t new_start = start_ + start;

852 854

uint64_t new_end = end_;

853 855

if (end.has_value()) {

854 -

new_end = std::min(end.value(), end_);

856 +

new_end = std::min(end.value() + start_, end_);

855 857

}

856 858 857 859

CHECK(new_start >= start_);

Original file line number Diff line number Diff line change

@@ -86,6 +86,16 @@ writeFileSync(testfile5, '');

86 86 87 87

const res1 = blob.slice(995, 1005);

88 88

strictEqual(await res1.text(), data.slice(995, 1005));

89 + 90 +

// Refs: https://github.com/nodejs/node/issues/53908

91 +

for (const res2 of [

92 +

blob.slice(995, 1005).slice(),

93 +

blob.slice(995).slice(0, 10),

94 +

blob.slice(0, 1005).slice(995),

95 +

]) {

96 +

strictEqual(await res2.text(), data.slice(995, 1005));

97 +

}

98 + 89 99

await unlink(testfile2);

90 100

})().then(common.mustCall());

91 101

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4