Repository navigation
Commit e654527
committed
fix(compiler): close local-callee bypass in plainCalleeIsMemoizable and add moduleFunctionBindings to autoMemoCallsitesSafe
Bug 1: plainCalleeIsMemoizable admitted any non-hook Identifier callee, but
locally-declared names (const read = () => item.read(); read()) can wrap
the member-callee hazard the veto intends to catch. Add
collectSurfaceDeclaredNames to collect names declared at the walked
surface (matching containsRenderCall's function-body boundary) and
exclude them from the plain-callee pass-through.
Bug 2: The autoMemoCallsitesSafe free-identifier loop checked importedNames,
defaultMemoBindings, and componentInfo but not moduleFunctionBindings,
causing components that call same-module function helpers to keep
currentAutoMemoCallsitesSafe false and block child callsite memoization.
Add the missing moduleFunctionBindings check.1 parent 72b5bbb commit e654527
1 file changed
Lines changed: 43 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2633 | 2633 | | |
2634 | 2634 | | |
2635 | 2635 | | |
| 2636 | + | |
2636 | 2637 | | |
2637 | 2638 | | |
2638 | 2639 | | |
| |||
2659 | 2660 | | |
2660 | 2661 | | |
2661 | 2662 | | |
2662 | | - | |
| 2663 | + | |
2663 | 2664 | | |
2664 | 2665 | | |
2665 | 2666 | | |
| |||
2715 | 2716 | | |
2716 | 2717 | | |
2717 | 2718 | | |
2718 | | - | |
| 2719 | + | |
2719 | 2720 | | |
2720 | 2721 | | |
2721 | 2722 | | |
2722 | | - | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
2723 | 2761 | | |
2724 | 2762 | | |
2725 | 2763 | | |
| |||
5291 | 5329 | | |
5292 | 5330 | | |
5293 | 5331 | | |
5294 | | - | |
| 5332 | + | |
| 5333 | + | |
5295 | 5334 | | |
5296 | 5335 | | |
5297 | 5336 | | |
| |||
0 commit comments