Allow storing util.getCallSites without capturing a stack

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

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

@jlucaso1 がすでに取り組んでいます。

2026年11月1日 から。

  • #2842 @jlucaso1 による — オープン

評価

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

調査の方向性

The payload points to lower-inspect.ts, where the direct JavaScript no-argument lowering of the call-site helper emits placeholder frames, and to the Node util.getCallSites export that Pino reads at startup in lib/caller.js. Start by reproducing the SC2020 failure with the snippet from the issue, which only reads the export and should not capture a stack. Done means the export is a callable value with Node's name and length, and invoking it raises an explicit refusal instead of returning invented frames. Full stack capture is out of scope, so confirm with maintainers before extending it.

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

説明

The unchanged Baileyrs example from oxidezap/baileyrs#176 builds with #2149 plus #2839, but --offline-smoke exits at startup with SC2020 in pino/lib/caller.js:7.

const util = require('node:util')
const capture = util.getCallSites ?? util.getCallSite
console.log(typeof capture)

Node prints function. Reading the export does not capture a stack. Pino imports this helper at startup and invokes it only when transport configuration needs caller resolution. An ordinary logger should not fail because a dormant function is imported.

Proposed bounded fix: materialize a stable callable value with Node's name and length, and defer an explicit SC2020 refusal until invocation. This does not implement stack capture, disable logging, or use Node islands. Capture must not silently return invented or empty frames.

Full capture is separate work. The existing direct JavaScript no-argument lowering in lower-inspect.ts emits three placeholder frames. Native source frames store function names and files, but not the current call's line and column. Correct capture needs actual caller locations, default/1–200 frame limits, source-map options, and contracts for optimized/inlined functions, fibers, workers, and unsupported targets. Instrumentation should remain gated to programs that observe stacks; a function import alone should not add per-call stack tracking.

References: Node v24.16 implementation, Pino caller helper, integration evidence.

Issue search for getCallSites returned no matches at triage.

主要言語
TypeScript
スター
6.5k
フォーク
212
平均マージ
13時間 2分
マージ済み PR(30日)
798

環境構築

はじめの一歩

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

vercel-labs/scriptc のほかの issue

vercel-labs/scriptc の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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