Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

originalPositionFor returns null if sourcemap does not contains the exact line.

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

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

評価

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

調査の方向性

lib/source-map-consumer.js の 616 行目付近から始め、issue にある複数行のチェーン呼び出しの例を、該当する正確な行がない sourcemap で再現します。originalPositionFor がマッピングの欠落をどのように処理するかを確認します。このケースで null ではなく最も近い source-map の位置を返せば完了です。

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

説明

needs-triage

originalPositionFor returns null if sourcemap does not contains the exact line.
It cause the issue with typescript(ts-node) that may not create source map for all the lines,
especially when the source contains multi-line chained function call like below.

let obj:any = null;
obj
.map();

In this case, the error happens on the last line. But, sourcemap does not have information on the line. So, the following code assume the mapping does not found and return null.

https://github.com/mozilla/source-map/blob/75663e0187002920ad98ed1de21e54cb85114609/lib/source-map-consumer.js#L616

It is much better to return the nearest source map position, instead of just return null.

主要言語
JavaScript
スター
3.7k
フォーク
370
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

mozilla/source-map のほかの issue

mozilla/source-map の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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