(coffeeName, jsName, expectedName)
| 569 | // minified. |
| 570 | |
| 571 | const assertName = async function (coffeeName, jsName, expectedName) { |
| 572 | const minifiedMap = new SourceMapGenerator({ |
| 573 | file: "test.js.min", |
| 574 | }); |
| 575 | minifiedMap.addMapping({ |
| 576 | generated: { line: 1, column: 4 }, |
| 577 | original: { line: 1, column: 4 }, |
| 578 | source: "test.js", |
| 579 | name: jsName, |
| 580 | }); |
| 581 | |
| 582 | const coffeeMap = new SourceMapGenerator({ |
| 583 | file: "test.js", |
| 584 | }); |
| 585 | coffeeMap.addMapping({ |
| 586 | generated: { line: 1, column: 4 }, |
| 587 | original: { line: 1, column: 0 }, |
| 588 | source: "test.coffee", |
| 589 | name: coffeeName, |
| 590 | }); |
| 591 | |
| 592 | let consumer = await new SourceMapConsumer(coffeeMap.toJSON()); |
| 593 | minifiedMap.applySourceMap(consumer); |
| 594 | consumer.destroy(); |
| 595 | |
| 596 | consumer = await new SourceMapConsumer(minifiedMap.toJSON()); |
| 597 | consumer.eachMapping(function (mapping) { |
| 598 | assert.equal(mapping.name, expectedName); |
| 599 | }); |
| 600 | consumer.destroy(); |
| 601 | }; |
| 602 | |
| 603 | // `foo = 1` -> `var foo = 1;` -> `var a=1` |
| 604 | // CoffeeScript doesn’t rename variables, so there’s no need for it to |
no test coverage detected
searching dependent graphs…