Indexed source maps: allGeneratedPositionsFor only returns positions from the first section that contains the source
Mantenedores costumam responder em até 5 dias
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript
- Domínio
- devtools
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- JavaScript
- Estrelas
- 3.7k
- Forks
- 392
- Merge médio
- 4d 18h
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de mozilla/source-map
-
SourceMapConsumer.fromSourceMap ignores its sourceMapUrl argumentTalvez já em andamento @sebxt assumiu há 19 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
mozilla/source-map#544 ·
Mantenedores costumam responder em até 5 dias
-
Indexed source maps: lastColumn is not clamped to the next section when the section does not start on line 1Talvez já em andamento @sebxt assumiu há 21 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
mozilla/source-map#542 ·
Mantenedores costumam responder em até 5 dias
-
Indexed column spans ignore section line offsets when clipping at the next sectionTalvez já em andamento @NUAAwqy assumiu há 26 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
mozilla/source-map#539 ·
Mantenedores costumam responder em até 5 dias
-
wasm-mappings fail to build with Rust 1.96+Talvez já em andamento @MatrixNeoKozak assumiu há 27 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
mozilla/source-map#530 ·
Mantenedores costumam responder em até 5 dias
-
allow wasm to be bundledTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
mozilla/source-map#527 ·
Mantenedores costumam responder em até 5 dias
Todas as issues de mozilla/source-map
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ImranR98/apps.obtainium.imranr.dev#2000 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
routing: the tray panel's stage stands still with motion reduced while a request is in flightAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
microsoft/monaco-editor#5577 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
obsidianmd/obsidian-help#1169 ·
Mantenedores costumam responder em até 2 dias
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish stepTalvez já em andamento @albertteoh assumiu hoje. Abertadocumentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
jaegertracing/jaeger-ui#4739 ·
Mantenedores costumam responder em até 1 dia