Interpreted Buffer search methods capture the original receiver
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp, typescript
- Domain
- backend
Research direction
Start by tracing how the interpreter handles Buffer property reads for indexOf and includes, then follow how those functions receive their call-time this value. The issue gives a reproducible example comparing SharpTS with Node.js v22.23.2; run it in both environments and confirm the property reads return shared functions and calls search the supplied receiver.
Written by the indexing model from the issue text.
Description
While checking #3885, I found a separate discrepancy in how the interpreter exposes these methods.
const a = Buffer.of(66), b = Buffer.of(65);
const f = a.indexOf, g = a.includes;
console.log(f === b.indexOf, g === b.includes);
console.log(f.call(b, 65), g.call(b, 65));
Node.js v22.23.2 prints true true and 0 true. SharpTS interpretation prints false false and -1 false. The property reads should return shared functions that search the call-time receiver.
- Dominant language
- C#
- Stars
- 156
- Forks
- 4
- Avg merge
- 13h 20m
- Merged PRs (30d)
- 47
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nickna/SharpTS
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SubtitleEdit/subtitleedit#17247 ·
Maintainers usually reply within 1 day
-
Restore test cleanup fails on Windows when restored files are read-onlyPossibly taken @JamBalaya56562 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
duplicati/duplicati#8046 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Bundles Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pyrevitlabs/pyRevit#4285 ·
Maintainers usually reply within 1 day
-
customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days