Skip to content

Commit 204ec3b

Browse files
authored
Merge pull request jashkenas#4340 from GeoffreyBooth/node-deprecations
Call synchronous `fs` methods using the `Sync` variants
2 parents 113675a + 9365aa3 commit 204ec3b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Cakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ task 'build:parser', 'rebuild the Jison parser (run build first)', ->
136136
helpers.extend global, require('util')
137137
require 'jison'
138138
parser = require('./lib/coffee-script/grammar').parser
139-
fs.writeFile 'lib/coffee-script/parser.js', parser.generate()
139+
fs.writeFileSync 'lib/coffee-script/parser.js', parser.generate()
140140

141141
task 'build:browser', 'rebuild the merged script for inclusion in the browser', ->
142142
code = ''

lib/coffee-script/repl.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/repl.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ addHistory = (repl, filename, maxSize) ->
108108
readFd = fs.openSync filename, 'r'
109109
buffer = new Buffer(size)
110110
fs.readSync readFd, buffer, 0, size, stat.size - size
111-
fs.close readFd
111+
fs.closeSync readFd
112112
# Set the history on the interpreter
113113
repl.rli.history = buffer.toString().split('\n').reverse()
114114
# If the history file was truncated we should pop off a potential partial line
@@ -123,10 +123,10 @@ addHistory = (repl, filename, maxSize) ->
123123
repl.rli.addListener 'line', (code) ->
124124
if code and code.length and code isnt '.history' and code isnt '.exit' and lastLine isnt code
125125
# Save the latest command in the file
126-
fs.write fd, "#{code}\n"
126+
fs.writeSync fd, "#{code}\n"
127127
lastLine = code
128128

129-
repl.on 'exit', -> fs.close fd
129+
repl.on 'exit', -> fs.closeSync fd
130130

131131
# Add a command to show the history stack
132132
repl.commands[getCommandId(repl, 'history')] =

test/error_messages.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if require?
8383
^^
8484
"""
8585
finally
86-
fs.unlink 'test/syntax-error.coffee'
86+
fs.unlinkSync 'test/syntax-error.coffee'
8787

8888

8989
test "#1096: unexpected generated tokens", ->

0 commit comments

Comments
 (0)