You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[repl] Tab completion crashes when invoked on in multiline mode after line with error #7716
Platform: OS X 10.11.5 on a Mac Mini late 2014, if relevant
Subsystem: repl
When in the repl in multiline node, specifically when typing a function body, tab completion crashes the repl when invoked on a new line if the previous line would produce an error on evaluating.
Minimal example: (<tab> indicates pressing the actual tab key)
> function(){
... some_undefined_thing;
... <tab>
repl.js:306
top.outputStream.write((e.stack || e) + '\n');
^
TypeError: Cannot read property 'outputStream' of undefined
at Domain.<anonymous> (repl.js:306:8)
at emitOne (events.js:96:13)
at Domain.emit (events.js:188:7)
at Domain.errorHandler [as _errorHandler] (domain.js:97:23)
at process._fatalException (node.js:247:33)
(Actually, repl.js:306 comes right after the ... on the line on which tab was pressed.)
Interestingly, this seems to be highly dependent on the exact conditions:
Activity
lieuwex commentedon Jul 13, 2016
Confirming I have this issue too on OS X 10.11.5 with node v6.3.0.
This issue doesn't seem to occur when using es6 arrow functions though,
doesn't crash the REPL.
evanlucas commentedon Jul 13, 2016
v5 is also affected. Haven't bisected yet though
evanlucas commentedon Jul 13, 2016
#7718 fixes it for me locally, but trying to see if there is a better fix.
repl: prevent undefined ref in completion