Closed rot1024 closed 1 year ago
Base: 97.34% // Head: 97.59% // Increases project coverage by +0.24%
:tada:
Coverage data is based on head (
195472b
) compared to base (402c146
). Patch coverage: 100.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This PR is a tentative solution to #20
The existing QuickJSContext has a problem that after about 3000~10000 calls to newFunction to create a function, the fnMap in the context is exhausted and function creation fails.
So, although a bit aggressive, wrap newFunction and override it so that newFunction is actually called only once. This can be done in principle by increasing the counter each time a new VmFunctionImplementation is received, storing it in a map, embedding only the ID in the VM-side function, and calling it from the map when it is called.
All unit tests passed without modification, but since QuickJSContext is wrapped to change its behavior, this feature will not be fully usable in a production environment until it is tried. Therefore, we have implemented this feature so that it will not work without the experimental flag enabled.