Indexed source maps: allGeneratedPositionsFor only returns positions from the first section that contains the source
I maintainer di solito rispondono entro 5 giorni
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- devtools
Direzione di ricerca
Start at IndexedSourceMapConsumer.prototype.allGeneratedPositionsFor and compare how it searches sections with how eachMapping reports mappings from both. Reproduce the example with two sections listing shared.js, then check that the result contains positions from both sections: lines 1 and 3, with columns 0 and 4. An open pull request (#565) is already linked to this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
IndexedSourceMapConsumer.prototype.allGeneratedPositionsFor looks up the first section whose map lists the requested source and returns positions from that section only. When the same original source appears in more than one section, for example a shared helper module that two concatenated chunks both include, positions in the later sections are missing from the result. Tools that use this method to set breakpoints on an original line miss those generated locations.
Steps to reproduce
const { SourceMapConsumer } = require("source-map");
(async () => {
const map = await new SourceMapConsumer({
version: 3,
file: "min.js",
sections: [
{
offset: { line: 0, column: 0 },
map: { version: 3, sources: ["shared.js"], names: [], mappings: "AAAA" },
},
{
offset: { line: 2, column: 4 },
map: { version: 3, sources: ["shared.js"], names: [], mappings: "AAAA" },
},
],
});
console.log(
map.allGeneratedPositionsFor({ source: "shared.js", line: 1, column: 0 })
);
map.destroy();
})();
Expected result
[ { line: 1, column: 0, lastColumn: null }, { line: 3, column: 4, lastColumn: null } ]
Actual result
[ { line: 1, column: 0, lastColumn: null } ]
map.sources lists shared.js twice, and eachMapping reports both mappings, so only allGeneratedPositionsFor drops the second one.
Reproduced on master at 8c668f3.
- Lingua principale
- JavaScript
- Stelle
- 3.7k
- Fork
- 392
- Merge medio
- 4g 18h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mozilla/source-map
-
SourceMapConsumer.fromSourceMap ignores its sourceMapUrl argumentForse già presa @sebxt l’ha presa 17 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mozilla/source-map#544 ·
I maintainer di solito rispondono entro 5 giorni
-
Indexed source maps: lastColumn is not clamped to the next section when the section does not start on line 1Forse già presa @sebxt l’ha presa 18 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mozilla/source-map#542 ·
I maintainer di solito rispondono entro 5 giorni
-
Indexed column spans ignore section line offsets when clipping at the next sectionForse già presa @NUAAwqy l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mozilla/source-map#539 ·
I maintainer di solito rispondono entro 5 giorni
-
wasm-mappings fail to build with Rust 1.96+Forse già presa @MatrixNeoKozak l’ha presa 25 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
mozilla/source-map#530 ·
I maintainer di solito rispondono entro 5 giorni
-
allow wasm to be bundledForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
mozilla/source-map#527 ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di mozilla/source-map
Issue simili
-
Administration: required plugin configuration field stays invalid after restoring its saved valueApertaneeds-triage Platform(Default)
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nearform/ag-grid-url-sync#314 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
idean3885/claude-ops-agent#910 ·
I maintainer di solito rispondono entro 1 giorno
-
S: triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
oskarrough/agent-ide#29 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno