Repository navigation
Commit a8f3151
committed
fix(compiler): track hook setters through member bindings and flatten destructured globals
Fix two Strong mode analysis bugs:
1. Hook setters missed on member bindings: Custom-hook return
provenance was not rebound when the initializer was a member
expression on the call (e.g. useThing()[1]), and stored
returned-array/returned-object shapes were never bound to
identifiers. Add returnedShapeElement helper to resolve member
accesses on call shapes and returned-shape bindings, extend
bindDeclaration to re-trigger binding for member expressions on
calls, remove the identifier exclusion in bindReturnedShape, and
use the helper in callableValue for callee resolution.
2. Destructured globals skip zero-delay checks: keyOf flattened
window/globalThis members to g:name for MemberExpression but
produced g:window.name for object-pattern aliases, which
globalFunction rejected due to the dot. Apply the same g:window
flattening in the declarator path that the MemberExpression path
already uses.1 parent 388bbb7 commit a8f3151
2 files changed
Lines changed: 45 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2745 | 2745 | | |
2746 | 2746 | | |
2747 | 2747 | | |
2748 | | - | |
2749 | | - | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
2750 | 2753 | | |
2751 | 2754 | | |
2752 | 2755 | | |
| |||
2895 | 2898 | | |
2896 | 2899 | | |
2897 | 2900 | | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
2898 | 2927 | | |
2899 | 2928 | | |
2900 | 2929 | | |
2901 | 2930 | | |
2902 | | - | |
| 2931 | + | |
2903 | 2932 | | |
2904 | 2933 | | |
2905 | 2934 | | |
| |||
3105 | 3134 | | |
3106 | 3135 | | |
3107 | 3136 | | |
3108 | | - | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
3109 | 3142 | | |
3110 | 3143 | | |
3111 | 3144 | | |
| |||
3489 | 3522 | | |
3490 | 3523 | | |
3491 | 3524 | | |
| 3525 | + | |
| 3526 | + | |
3492 | 3527 | | |
3493 | 3528 | | |
3494 | 3529 | | |
| |||
0 commit comments