Skip to content

Commit fecdbac

Browse files
A particular REPL test is broken in Node 4.8.2 because of a regression that was fixed in Node 5.11.0; just disable the test for Node < 6. Fixes #4502. (#4510)
1 parent 473e8a1 commit fecdbac

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

lib/coffee-script/repl.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/repl.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ getCommandId = (repl, commandName) ->
145145

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

150150
if major is 0 and minor < 8
151151
console.warn "Node 0.8.0+ required for CoffeeScript REPL"

test/repl.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ testRepl "variables are saved", (input, output) ->
6767
eq "'foobar'", output.lastWrite()
6868

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

0 commit comments

Comments
 (0)