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 bug fixes #2163

Closed
wants to merge 4 commits into from
Closed

Commits on Jul 22, 2015

  1. repl: fixing undefined in invalid REPL keyword error

    When an invalid REPL keyword is used, we actually print `undefined` as
    well in the console.
    
        > process.version
        'v2.3.4'
        > .invalid_repl_command
        Invalid REPL keyword
        undefined
        >
    
    This patch prevents printing `undefined` in this case.
    
        > process.version
        'v2.3.5-pre'
        > .invalid_repl_command
        Invalid REPL keyword
        >
    thefourtheye committed Jul 22, 2015
    Configuration menu
    Copy the full SHA
    cdc63cb View commit details
    Browse the repository at this point in the history
  2. repl: preventing REPL crash with inherited properties

    When an inherited property is used as a REPL keyword, the REPL crashes.
    
        ➜  Desktop  iojs
        > process.version
        'v2.3.4'
        > .toString
        readline.js:913
                stream[ESCAPE_DECODER].next(r[i]);
                                        ^
        TypeError: Cannot read property 'call' of undefined
            at REPLServer.parseREPLKeyword (repl.js:746:15)
            at REPLServer.<anonymous> (repl.js:284:16)
            at emitOne (events.js:77:13)
            at REPLServer.emit (events.js:169:7)
            at REPLServer.Interface._onLine (readline.js:210:10)
            at REPLServer.Interface._line (readline.js:549:8)
            at REPLServer.Interface._ttyWrite (readline.js:826:14)
            at ReadStream.onkeypress (readline.js:105:10)
            at emitTwo (events.js:87:13)
            at ReadStream.emit (events.js:172:7)
        ➜  Desktop
    
    This patch makes the internal `commands` object inherit from `null` so
    that there will be no inherited properties.
    
        > process.version
        'v2.3.5-pre'
        > .toString
        Invalid REPL keyword
        >
    thefourtheye committed Jul 22, 2015
    Configuration menu
    Copy the full SHA
    302fc96 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2015

  1. repl: improving line continuation handling

    As it is, REPL doesn't honour the line continuation feature very well.
    This patch
    
     1. keeps track of the beginning of the string literals and if they
        don't end or current line doesn't end with line continuation, then
        error out.
    
     2. monitors if the line continuation character is used without the
        string literal and errors out if that happens.
    thefourtheye committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    769bd2f View commit details
    Browse the repository at this point in the history
  2. repl: better empty line handling

    In REPL, if we try to evaluate an empty line, we get `undefined`.
    
        > process.version
        'v2.3.4'
        >
        undefined
        >
        undefined
        >
    
    This patch prevents `undefined` from printing if the string is empty.
    
        > process.version
        'v2.3.5-pre'
        >
        >
        >
    thefourtheye committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    b54f153 View commit details
    Browse the repository at this point in the history