Last active
December 24, 2015 21:49
-
-
Save tkareine/6868220 to your computer and use it in GitHub Desktop.
Using CoffeeScript 1.6.3 (rev 581af4540ac).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q = require 'q' | |
value = if this.require 'aa' else 'bb' # missing `then` in `if` expr; should be compile error | |
incorrectChain = Q.nfcall(fun).then( | |
(result) -> console.log 'Result', result | |
, (error) -> console.error 'Error', error # a small indentation error | |
) | |
fun = (callback) -> callback(new Error('intentional error')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by CoffeeScript 1.6.3 | |
(function() { | |
var Q, fun, incorrectChain, value; | |
Q = require('q'); | |
value = this.require('aa') ? void 0 : 'bb'; | |
incorrectChain = Q.nfcall(fun).then(function(result) { | |
return console.log('Result', result, function(error) { | |
return console.error('Error', error); | |
}); | |
}); | |
fun = function(callback) { | |
return callback(new Error('intentional error')); | |
}; | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment