Skip to content

Node REPL preprocessing input string for custom eval functions #9743

Description

@YarnSphere
  • Version: 7.1.0
  • Platform: Linux 4.8.8-2-ARCH
  • Subsystem: REPL

Run the following:

require('repl').start({
  eval: function(input, context, filename, cb) {
    console.log(input);
    cb(null);
  }
});

When inside the REPL write function f() {}. The REPL will log var f = function f() {}.
This sort of preprocessing should only happen for the default eval function.

The line where the preprocessing occurs: repl.js#L503
This should probably be moved to inside the defaultEval function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions