Interpreted Buffer search methods capture the original receiver

オープン
#3,891 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, typescript
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
156
フォーク
4
平均マージ
13時間 20分
マージ済み PR(30日)
47

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nickna/SharpTS のほかの issue

nickna/SharpTS の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。