* What the function `text` resolves to when called, `param` handed to its * first parameter: its expression body's value, or what the first `return` * of its body hands back. Null for a function this does not read.
(text: string, outer: LoaderScope, param: Loaded | null = null)
| 1635 | * of its body hands back. Null for a function this does not read. |
| 1636 | */ |
| 1637 | function loaderValue(text: string, outer: LoaderScope, param: Loaded | null = null): Loaded | null { |
| 1638 | const fn = functionParts(text); |
| 1639 | if (!fn) return null; |
| 1640 | const scope = new Map(outer); |
| 1641 | topLevelItems(fn.params).forEach((p, i) => bindPattern(scope, parameterPattern(p), i === 0 ? param : null)); |
| 1642 | return fn.block ? blockValue(fn.body, scope) : valueOf(fn.body, scope); |
| 1643 | } |
| 1644 | |
| 1645 | /** |
| 1646 | * An arrow function's or a `function`'s parameter list and body, its |
no test coverage detected