facebookarchive / prepack

A JavaScript bundle optimizer.
http://prepack.io
Other
14.21k stars 424 forks source link

adding new __replaceFunctionImplementation_unsafe built-in #2533

Closed NTillmann closed 6 years ago

NTillmann commented 6 years ago

Release notes: providing __replaceFunctionImplementation_unsafe built-in

This new built-in allows replacing the method implementation (capture environment, body, ...) of source functions.

As a result, all method calls executed by the Prepack interpreter will be redirected, and the replacement will carry over to the prepacked code.

hermanventer commented 6 years ago

This seems simple enough, but I am lost trying to figure out why you need it. I'm also not quite sure it is correct. I don't have any particular reason to believe it is incorrect, but it is not OBVIOUSLY correct either.