Commit 4ea0cc5
fix(jsi): resolve Symbol.dispose without JS eval (#3855)
JsiHostObject::get fell back to runtime.global().eval("Symbol.for('Symbol.dispose');")
for the dispose-symbol lookup on every property miss. With a Hermes build that
disables the JS eval builtin,
the first miss throws an uncaught jsi::JSError and crashes the app on boot —
reproducibly seen when Reanimated 4 worklets access `_isReanimatedSharedValue`
on a Skia HostObject during MapperRegistry setup.
Replace the eval invocation with a direct JSI traversal of `Symbol.for`. The
behaviour is equivalent (Symbol.for("Symbol.dispose") returns the same well-known
symbol regardless of how it is reached) and the path no longer depends on the JS
eval builtin being available.
Remove the now-unused `RNJsi::eval` helper (no other consumers in this file or
across the package).
Co-authored-by: William Candillon <wcandillon@gmail.com>1 parent 5802477 commit 4ea0cc5
1 file changed
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 27 | | |
34 | 28 | | |
35 | 29 | | |
| |||
86 | 80 | | |
87 | 81 | | |
88 | 82 | | |
89 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
| |||
0 commit comments