( generatedLine, generatedColumn, originalSource, originalLine, originalColumn, name, bias, map, assert, dontTestGenerated, dontTestOriginal )
| 293 | }; |
| 294 | |
| 295 | function assertMapping( |
| 296 | generatedLine, |
| 297 | generatedColumn, |
| 298 | originalSource, |
| 299 | originalLine, |
| 300 | originalColumn, |
| 301 | name, |
| 302 | bias, |
| 303 | map, |
| 304 | assert, |
| 305 | dontTestGenerated, |
| 306 | dontTestOriginal |
| 307 | ) { |
| 308 | if (!dontTestOriginal) { |
| 309 | const origMapping = map.originalPositionFor({ |
| 310 | line: generatedLine, |
| 311 | column: generatedColumn, |
| 312 | bias, |
| 313 | }); |
| 314 | assert.equal( |
| 315 | origMapping.name, |
| 316 | name, |
| 317 | "Incorrect name, expected " + |
| 318 | JSON.stringify(name) + |
| 319 | ", got " + |
| 320 | JSON.stringify(origMapping.name) |
| 321 | ); |
| 322 | assert.equal( |
| 323 | origMapping.line, |
| 324 | originalLine, |
| 325 | "Incorrect line, expected " + |
| 326 | JSON.stringify(originalLine) + |
| 327 | ", got " + |
| 328 | JSON.stringify(origMapping.line) |
| 329 | ); |
| 330 | assert.equal( |
| 331 | origMapping.column, |
| 332 | originalColumn, |
| 333 | "Incorrect column, expected " + |
| 334 | JSON.stringify(originalColumn) + |
| 335 | ", got " + |
| 336 | JSON.stringify(origMapping.column) |
| 337 | ); |
| 338 | |
| 339 | let expectedSource; |
| 340 | |
| 341 | if ( |
| 342 | originalSource && |
| 343 | map.sourceRoot && |
| 344 | originalSource.indexOf(map.sourceRoot) === 0 |
| 345 | ) { |
| 346 | expectedSource = originalSource; |
| 347 | } else if (originalSource) { |
| 348 | expectedSource = map.sourceRoot |
| 349 | ? util.join(map.sourceRoot, originalSource) |
| 350 | : originalSource; |
| 351 | } else { |
| 352 | expectedSource = null; |
nothing calls this directly
no test coverage detected
searching dependent graphs…