Commit f2bf0a6
committed
Slice prepended scope arg out of user-visible arguments.length
When the scope pass prepends a $$scope argument and toildefender$bind-wraps a
function, user-visible `arguments` must exclude the injected arg. The slice
count was gated on methodRefersToArguments(), which only detects *unresolved*
`arguments` references and misses `arguments.length` (escope resolves
`arguments`). Brand-check helpers (the shape of `#x in obj` / private getters)
then read an off-by-one `arguments.length` and returned the wrong branch,
corrupting downlevelled #private access -- e.g. a WeakMap receiving undefined as
a key. Always slice by the $$scope param count instead.
This is what broke ToilGate's fully-obfuscated build with numeric_vm + dead_code
(dead_code kept the helper native, exposing the path the VM's slice had masked).
Verified end-to-end.1 parent 9c6fc08 commit f2bf0a6
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
801 | | - | |
802 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
803 | 811 | | |
804 | 812 | | |
805 | 813 | | |
| |||
0 commit comments