This package has limited bug data (1 entry). Check back later or see the package health page for the full signal.
source-map known bugs
npm1 known bug in source-map, with affected versions, fixes and workarounds. Sourced from upstream issue trackers.
1
bugs
Known bugs
| Severity | Affected | Fixed in | Title | Status | Source |
|---|---|---|---|---|---|
| medium | any | \u2014 | Original position lookup in an indexed source map can fail due to failure to find the right section Here's an example test case:
```js
// add to test/test-source-map-consumer
exports["test a mapping at the boundary of indexed source map offset"] =
async function (assert) {
const map = await new SourceMapConsumer(util.indexedTestMapAtOffsetBoundary);
util.assertMapping(1, 0, "/the/root/one.js", 1, 0, null, null, map, assert);
map.destroy();
};
```
```js
// add to test/util.js
// This mapping is for testing a case where the mapped position is at the
// section offset.
exports.indexedTestMapAtOffsetBoundary = {
version: 3,
file: "min.js",
sections: [
{
offset: {
line: 0,
column: 0,
},
map: {
version: 3,
sources: ["one.js"],
sourcesContent: [
"ONE.foo = function (bar) {\n return baz(bar);\n };",
],
names: ["bar", "baz"],
mappings: "AAAA",
file: "min.js",
sourceRoot: "/the/root",
},
},
],
};
```
Currently it would fail like this:
```
FAILED ./test-source-map-consumer: test a mapping at the boundary of indexed source map offset!
AssertionError [ERR_ASSERTION]: Incorrect line, expected 1, got null
at Object.assertMapping (/home/asumu/source-map/test/util.js:322:12)
at exports.test a mapping at the boundary of indexed source map offset (/home/asumu/source-map/test/test-source-map-consumer.js:2190:10)
at async run (/home/asumu/source-map/test/run-tests.js:21:11)
```
In this test, the index map has a section at offset line 0, column 0. The section has a single mapping from 0, 0 -> 0, 0. This should behave the same as a regular source map with just that one section.
However, the test actually fails because the section lookup fails. I think this is actually due to an off-by-one error in the section lookup code, which I'll submit a PR for. | fixed | github:506 |
API access
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/bugs/npm/source-map