mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix #4178: an issue of processing Unicode characters in stdin
This commit is contained in:
@@ -207,12 +207,12 @@ compileScript = (file, input, base = null) ->
|
||||
# Attach the appropriate listeners to compile scripts incoming over **stdin**,
|
||||
# and write them back to **stdout**.
|
||||
compileStdio = ->
|
||||
code = ''
|
||||
buffers = []
|
||||
stdin = process.openStdin()
|
||||
stdin.on 'data', (buffer) ->
|
||||
code += buffer.toString() if buffer
|
||||
buffers.push buffer if buffer
|
||||
stdin.on 'end', ->
|
||||
compileScript null, code
|
||||
compileScript null, Buffer.concat(buffers).toString()
|
||||
|
||||
# If all of the source files are done being read, concatenate and compile
|
||||
# them together.
|
||||
|
||||
Reference in New Issue
Block a user