This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Leaking of __empty
variable and highly inefficient optimization
#2573
Labels
Whilst working with React children, one of the operations we do is "flatten" arrays. This is a very common use-case in JS applications and it seems to be one that Prepack struggles to do when the abstract contains abstract elements/lengths.
Take the below case:
The output for this is:
You can see we have
__empty
serialized out above, which accordingly to @NTillmann, should never happen.The output that Prepack creates is not optimal at all and definitely will hit the slow paths in all JS VMs. Ideally what we should be outputting in the base-case is this:
The text was updated successfully, but these errors were encountered: