Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using CoffeeScript 1.6.3 (rev 581af4540ac).
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'))
// 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