Skip to content

Commit

Permalink
A particular REPL test is broken in Node 4.8.2 because of a regressio…
Browse files Browse the repository at this point in the history
…n that was fixed in Node 5.11.0; just disable the test for Node < 6. Fixes #4502. (#4510)
  • Loading branch information
GeoffreyBooth authored Apr 17, 2017
1 parent 473e8a1 commit fecdbac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/coffee-script/repl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/repl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ getCommandId = (repl, commandName) ->

module.exports =
start: (opts = {}) ->
[major, minor, build] = process.versions.node.split('.').map (n) -> parseInt(n)
[major, minor, build] = process.versions.node.split('.').map (n) -> parseInt(n, 10)

if major is 0 and minor < 8
console.warn "Node 0.8.0+ required for CoffeeScript REPL"
Expand Down
5 changes: 5 additions & 0 deletions test/repl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ testRepl "variables are saved", (input, output) ->
eq "'foobar'", output.lastWrite()

testRepl "empty command evaluates to undefined", (input, output) ->
# A regression fixed in Node 5.11.0 broke the handling of pressing enter in
# the Node REPL; see https://github.com/nodejs/node/pull/6090 and
# https://github.com/jashkenas/coffeescript/issues/4502.
# Just skip this test for versions of Node < 6.
return if parseInt(process.versions.node.split('.')[0], 10) < 6
input.emitLine ''
eq 'undefined', output.lastWrite()

Expand Down

0 comments on commit fecdbac

Please sign in to comment.