You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lazy compilation does not respect "show source", so [function].toString() fails to provide useful output.
This is observable under React Native, typically when loading a bundle in development, where we use lazy compilation for input JS exceeding 64KB. It makes "show source" quite unpredictable. Unknown whether other directives are similarly affected.
The symptoms have been reported before but not narrowed down to a lazy compilation issue:
This is due to a problem in how lazy compilation resolves the function sources table in main Hermes. It always tries to lookup on the root RuntimeModule, which is only valid if the function was declared at the top level (which is why our test lazy-function-toString.js passes).
In reality, we'd have to be able to look up the function source in the parentRuntimeModule. We don't currently store this information, so it'd require more than a trivial change to main Hermes to fix.
This does work in Static Hermes, because we've simplified the lazy compilation mechanism significantly and now all the tables are shared among all the compilation invocations.
I am applying the label fixed-in-sh, meaning that this has been fixed in Static Hermes but is "Wontfix" in Hermes. We need this label because technically SH has not been released yet, but at the same time we don't want to keep issues like this open.
Bug Description
Lazy compilation does not respect "show source", so
[function].toString()
fails to provide useful output.This is observable under React Native, typically when loading a bundle in development, where we use lazy compilation for input JS exceeding 64KB. It makes "show source" quite unpredictable. Unknown whether other directives are similarly affected.
The symptoms have been reported before but not narrowed down to a lazy compilation issue:
Hermes git revision (if applicable): current / 579e82b
React Native version: N/A
OS: macOS / iOS
Platform: arm64
Steps To Reproduce with Hermes CLI
'show source'
respected with eager compilationBut fails with lazy compilation
The Expected Behavior
Lazy compilation doesn't change observable behaviour -
show source
should work both ways.The text was updated successfully, but these errors were encountered: