Repository navigation
Commit 822cfc4
Preserve null NodeList forEach context (#58243)
Summary:
`NodeList.forEach` currently treats both null and undefined as the omitted-context fast path, so a strict callback receives undefined when the caller explicitly supplied null. Use the fast path only for undefined and cover the standards-compatible null receiver.
Fixes #58242.
## Changelog:
[GENERAL] [FIXED] - Preserve an explicit null `thisArg` in NodeList.forEach callbacks.
Pull Request resolved: #58243
Test Plan:
- Exact upstream focused suite: 12 existing tests passed and the new null-context regression failed.
- Fixed focused Fantom suite: 13/13 passed.
- Fresh Flow check: 0 errors.
- Targeted no-ignore ESLint, Prettier, and `git diff --check` passed.
Only the observably incorrect explicit-null context changes; omitted and undefined contexts are unchanged.
Reviewed By: christophpurrer
Differential Revision: D123889530
Pulled By: rubennorte
fbshipit-source-id: ddca4cd7d2e62c8dcf40cc7b583fa15d74127afa1 parent ff78e95 commit 822cfc4
2 files changed
Lines changed: 13 additions & 1 deletion
File tree
- packages/react-native/src/private/webapis/dom/oldstylecollections
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
169 | 181 | | |
170 | 182 | | |
171 | 183 | | |
| |||
0 commit comments