Commit d852dc3
fix(utils): tolerate null self in worker runtime detection
typeof null is 'object', so a mocked environment defining self = null passed
the typeof guard and the importScripts access would throw. Optional chaining
degrades it to undefined and falls through to the server checks, matching the
file's existing navigator?.sendBeacon idiom.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7d47d87 commit d852dc3
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
0 commit comments