Skip to content

Instantly share code, notes, and snippets.

@tkareine
Last active December 24, 2015 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tkareine/6868220 to your computer and use it in GitHub Desktop.
Save tkareine/6868220 to your computer and use it in GitHub Desktop.
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