Description
At #23837 (comment), @jdalton proposed that instead of returning a function with certain special properties, vm.compileFunction
should instead return an object with the said properties and the function stored as the value
property on the object.
This approach was infact discussed during the design phase of compileFunction
, and I agree that either approach has it's own merits, but I decided to go with the status quo because it was consistent with similar functions in the vm module and consistency is really important IMO.
I'm opening this issue as suggested by @jdalton to open a discussion regarding what the best way to return information from these functions will be, moving forward.
I have three options in mind:
- Continue with the status quo (consistent).
- Make
vm.compileFunction
return an Object (inconsistent). - Make all similar functions return Objects (consistent).
Feel free to back one of the above or suggest something else entirely. The updates (if any) will have to be semver-major, but thankfully vm is probably one of the least used modules externally (vs internally).