SC8006 mistakes shadowed parameters for builtin module patches
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- nodejs, typescript
- 領域
- compilers
調査の方向性
Start with the scanner state keyed by identifier text: builtinBindings, cjsBuiltinObjects, and createdRequires. Reproduce with the reduced annotate(data) example, which should raise SC8006 today. Done means the shadowed write stays native while a genuine data.sdkProcessingMetadata = 1 outside the function is still refused. Pull request #2921 is already open against this, so check it before starting.
索引モデルが issue の本文から書いたものです。
説明
We are trying to compile the full Sentry CLI with scriptc while retaining its commands, SQLite fallback, and Ink/React UI. A fresh CommonJS bundle stops with SC8006 in Sentry SDK event-metadata code: scriptc treats a write through a local function parameter as a mutation of Node's path module.
The reduced example does not patch the builtin:
const data = require("node:path");
function annotate(data) {
data.sdkProcessingMetadata = 1;
return data.sdkProcessingMetadata;
}
console.log(annotate({}), typeof data.sdkProcessingMetadata);
Node 24.22.1 prints:
1 undefined
Building the same file with scriptc built from current main at the time of reproduction fails with SC8006, claiming that the entry module patches path.sdkProcessingMetadata. Replacing the first line with import data from "node:path" in an .mjs file reproduces the same refusal.
The parameter refers to the object passed to annotate. It shadows the imported builtin alias, and the builtin remains unchanged. The expected behavior is to keep this write native while preserving the refusal for a genuine write such as data.sdkProcessingMetadata = 1 outside the function.
The scanner currently keys builtinBindings, cjsBuiltinObjects, and createdRequires by identifier text across an entire module. Registering a parameter does not mask a same-named outer alias. Distinct local aliases can also overwrite one another's builtin identity. Removing the outer alias globally when encountering a parameter would hide genuine writes after the function, so the alias state needs to follow lexical bindings.
Regression coverage should include CommonJS and default-import aliases, parameters and local declarations, aliases created inside shadowed scopes, captured outer aliases, and genuine patches before and after an inner scope. Reads and patch forms such as Object.assign, Object.defineProperty, and delete should resolve the same binding. Recorded aliases of a createRequire result should also follow their lexical binding when captured or shadowed.
I checked existing issues and PRs before opening this. The overlapping scanner changes in #2592 and #2828 concern direct builtin reads and global-read tracking; neither addresses this alias-shadowing case. Fixing this refusal would remove one blocker from the CLI experiment, rather than establish that the full CLI compiles or runs correctly.
- 主要言語
- TypeScript
- スター
- 6.4k
- フォーク
- 204
- 平均マージ
- 7時間 35分
- マージ済み PR(30日)
- 873
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
vercel-labs/scriptc のほかの issue
-
`process.execPath` uses the ANSI API on Windows, so non-ASCII paths are garbled when the ANSI code page is not UTF-8対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 半日 初心者へのやさしさ 72/100
vercel-labs/scriptc#2910 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Assigning a wide Node object (process.stdout) to a narrow { write } record fails SC2002 (width-copy rules)対応中かも @ctate が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
vercel-labs/scriptc#2949 ·
メンテナーはふだん 1 日以内に返信
-
Analysis OOM (exit 137 at ~4 GB) on large TypeScript graphs対応中かも @espetro が 2 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
vercel-labs/scriptc#2916 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Publish prebuilt @scriptc/libnode-* packs with the native installer対応中かも @ctate が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
vercel-labs/scriptc#2915 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
http.Server should lower off, listeners, and newListener for HTTP events対応中かも @espetro が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
vercel-labs/scriptc#2913 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
vercel-labs/scriptc の issue をすべて見る
似ている issue
-
area: web bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
kinqsradio/orbyn-engineering#227 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
joeldesante/TurfBuilder#258 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ncecere/open-mcp-portal#85 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
loathers/garbage-collector#2865 ·
メンテナーはふだん 1 日以内に返信
-
test-reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Azure/azure-sdk-for-js#40672 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信