Indexed source maps: allGeneratedPositionsFor only returns positions from the first section that contains the source
Maintainer thường phản hồi trong vòng 5 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- devtools
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 3.7k
- Fork
- 392
- Merge trung bình
- 4 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mozilla/source-map
-
SourceMapConsumer.fromSourceMap ignores its sourceMapUrl argumentCó thể đã có người làm @sebxt đã nhận 18 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mozilla/source-map#544 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Indexed source maps: lastColumn is not clamped to the next section when the section does not start on line 1Có thể đã có người làm @sebxt đã nhận 20 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mozilla/source-map#542 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Indexed column spans ignore section line offsets when clipping at the next sectionCó thể đã có người làm @NUAAwqy đã nhận 25 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mozilla/source-map#539 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
wasm-mappings fail to build with Rust 1.96+Có thể đã có người làm @MatrixNeoKozak đã nhận 26 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mozilla/source-map#530 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
allow wasm to be bundledCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
mozilla/source-map#527 ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của mozilla/source-map
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
microsoft/monaco-editor#5575 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
digitalbazaar/forge#1170 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày