You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// add to test/test-source-map-consumerexports["test a mapping at the boundary of indexed source map offset"]=asyncfunction(assert){constmap=awaitnewSourceMapConsumer(util.indexedTestMapAtOffsetBoundary);util.assertMapping(1,0,"/the/root/one.js",1,0,null,null,map,assert);map.destroy();};
// 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.
The text was updated successfully, but these errors were encountered:
Here's an example test case:
Currently it would fail like this:
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.
The text was updated successfully, but these errors were encountered: