Skip to content

vm.compileFunction should return an object #23923

Closed
@ryzokuken

Description

@ryzokuken

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:

  1. Continue with the status quo (consistent).
  2. Make vm.compileFunction return an Object (inconsistent).
  3. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.stalevmIssues and PRs related to the vm subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions