Commit 7019424
authored
fix(extractor): narrow .call/.apply/.bind skip in extractCallbackReferenceCalls (#1420)
* fix(extractor): narrow .call/.apply/.bind skip in extractCallbackReferenceCalls
For .call()/.apply(): the first argument is the this-context and is now
skipped; subsequent identifier arguments are emitted as genuine callbacks.
e.g. forEach.call(arr, handler) → emits handler, not arr.
For .bind(): all arguments are absorbed into the partially-applied function
and none are direct callbacks — return [] immediately.
Closes #1406
* fix(extractor): treat .apply() like .bind() — its argsArray is never a callback
Unlike .call(thisArg, cb1, cb2…), .apply() takes exactly two args:
thisArg and a single argsArray. The array is never a direct callback,
so emitting its identifier (e.g. Math.max.apply(null, numbers) → edge
to numbers) is a false-positive. Return [] immediately for .apply(),
same as .bind(). Update the unit test to assert no edges are emitted.
* test(extractor): align .call()-with-only-this-context assertion style (#1420)1 parent 9037c13 commit 7019424
2 files changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2905 | 2905 | | |
2906 | 2906 | | |
2907 | 2907 | | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
2908 | 2913 | | |
2909 | 2914 | | |
2910 | 2915 | | |
| |||
2916 | 2921 | | |
2917 | 2922 | | |
2918 | 2923 | | |
| 2924 | + | |
2919 | 2925 | | |
2920 | 2926 | | |
2921 | 2927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
853 | 879 | | |
854 | 880 | | |
855 | 881 | | |
| |||
0 commit comments