-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
vm.compileFunction should return an object #23923
Copy link
Copy link
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.Issues that need assistance from volunteers or PRs that need help to proceed.stalevmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.Issues that need assistance from volunteers or PRs that need help to proceed.stalevmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
At #23837 (comment), @jdalton proposed that instead of returning a function with certain special properties,
vm.compileFunctionshould instead return an object with the said properties and the function stored as thevalueproperty 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:
vm.compileFunctionreturn an Object (inconsistent).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).