Commit 97b7092
committed
fix(runtime): add Object.hasOwn polyfill for Hermes compatibility
Hermes (React Native's default JS engine) doesn't support Object.hasOwn
(ES2022). This causes runtime errors when @vitest/expect v4.x initializes
because it uses Object.hasOwn internally.
Error without fix:
```
Object.hasOwn is not a function. (In 'Object.hasOwn(globalThis, MATCHERS_OBJECT)', 'Object.hasOwn' is undefined)
```
Add polyfill in runtime package that loads before @vitest/expect.
Tracking: facebook/hermes#18751 parent 14ccacc commit 97b7092
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments