(
{ body, returned }: WrittenUnits,
parse: UnitsParser,
pass: UnitsPass
)
| 1553 | ) => boolean | void |
| 1554 | |
| 1555 | const untilUnchanged = ( |
| 1556 | { body, returned }: WrittenUnits, |
| 1557 | parse: UnitsParser, |
| 1558 | pass: UnitsPass |
| 1559 | ): WrittenUnits => { |
| 1560 | for (;;) { |
| 1561 | const code = `${body}\n;${returned}` |
| 1562 | const s = new MagicString(code) |
| 1563 | const isSettled = pass(parse(code), s, body) |
| 1564 | if (!s.hasChanged()) return { body, returned } |
| 1565 | returned = s.slice(body.length + 2, code.length) |
| 1566 | body = s.slice(0, body.length) |
| 1567 | if (isSettled) return { body, returned } |
| 1568 | } |
| 1569 | } |
| 1570 | |
| 1571 | // a constant declared as another, or a function only forwarding its parameters, is read as that one |
| 1572 | const skipAliases: UnitsPass = ({ program, scopes }, s) => { |
no test coverage detected