Compiled process.eventNames bypasses a replacement global process

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp, typescript
領域
compilers

調査の方向性

Start by running the supplied reproduction with SharpTS interpretation and with the standalone compile and verify commands; compare the receiver used by compiled process.eventNames() with the replacement global process. Trace the compiler path for this call and check nearby coverage for compiled process methods. Done means the standalone program prints ["replacement"], matching the interpreter and Node.js output.

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

説明

While verifying #3823, I found that compiled process.eventNames() also bypasses a replacement global receiver.

const original = process;
const replacement = {
    eventNames() { return this === replacement ? ['replacement'] : ['wrong receiver']; }
};
globalThis.process = replacement;
const names = process.eventNames();
globalThis.process = original;
console.log(JSON.stringify(names));
  • Node.js v22.23.2 and SharpTS interpretation print ["replacement"].
  • SharpTS IL-verified standalone prints [].

Reproduced on 7f342ac7c with sharpts --no-tsconfig --noLib repro.js. To verify standalone output, run sharpts --no-tsconfig --noLib --compile repro.js --standalone --verify -o repro.dll and then dotnet repro.dll.

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

環境構築

はじめの一歩

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

nickna/SharpTS のほかの issue

nickna/SharpTS の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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