Skip to content

Commit

Permalink
use false for the error object for when things go well, instead of null
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexJWayne committed Jan 13, 2012
1 parent cd5ae61 commit f7215b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions coffeeson.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fileToJSON = (name, args..., cb) ->
fs.readFile name, (err, src) ->
if cb
return cb err if err
cb null, toJSON(src, args...)
cb no, toJSON(src, args...)
return

# Asynchronously read a file and callback with the content as pretty JSON
Expand All @@ -36,7 +36,7 @@ convertFile = (name, args..., cb) ->
fs.writeFile name.replace(/\.coffeeson$/, '.json'), json, (err) ->
if cb
return cb err if err
cb null, json
cb no, json
return

# Asynchronously read a file and save a pretty .json file right next the source file
Expand Down
4 changes: 2 additions & 2 deletions test/coffeeson_test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe 'coffeeson', ->
it '.convertFile() async reads a coffeeson file and writes a json file right next to it', (done) ->
coffeeson.convertFile 'test/sample.coffeeson', (err) ->
# ensure no error
(!!err).should.not.be.ok # should.js wtf?
err.should.not.be.ok

# Ensure the file was written
path.exists 'test/sample.json', (exists) ->
Expand All @@ -85,7 +85,7 @@ describe 'coffeeson', ->
it '.convertFilePretty() async reads a coffeeson file and writes a pretty json file right next to it', (done) ->
coffeeson.convertFilePretty 'test/sample.coffeeson', (err) ->
# ensure no error
(!!err).should.not.be.ok # should.js wtf?
err.should.not.be.ok

# Ensure the file was written
path.exists 'test/sample.json', (exists) ->
Expand Down

0 comments on commit f7215b1

Please sign in to comment.