Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: Proposal for better repl (implementation) #9601

Closed
wants to merge 7 commits into from

Commits on Apr 2, 2017

  1. repl: REPL enhancements

    * Welcome message with version and help guide
        * `displayWelcomeMessage` flag is used to
          turn on/off
    * Differentiate execute & continue actions
        * ^M or enter key to execute the command
        * ^J to continue building multiline expression.
        * `executeOnTimeout` value is used to determine
          the end of expression when `terminal` is false.
    * Pretty stack trace.
        * REPL specific stack frames are removed before
          emitting to output stream.
    * Recoverable errors.
        * No more recoverable errors & no false positives.
    * Defined commands(like .exit, .load) are meaningful
      only at the top level.
    * Remove `.break` command.
    
    Welcome message template
    ------------------------
    ```js
    $ node
    Welcome to Node.js <<version>> (<<vm name>> VM, <<vm version>>)
    Type ^M or enter to execute, ^J to continue, ^C to exit
    Or try
    
    ```
    
    Pretty stack trace
    ------------------
    ```js
    $ node -i
    > throw new Error('tiny stack')
    Error: tiny stack
        at repl:1:7
    > var x y;
    var x y;
          ^
    SyntaxError: Unexpected identifier
    >
    ```
    princejwesley committed Apr 2, 2017
    Configuration menu
    Copy the full SHA
    48414f0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b34c110 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a60da69 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d6cee38 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f304f8c View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2017

  1. Add doc for ^M and ^J

    princejwesley committed Apr 3, 2017
    Configuration menu
    Copy the full SHA
    2d5feff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a3047dc View commit details
    Browse the repository at this point in the history