Created
November 2, 2012 02:59
-
-
Save motin/3998426 to your computer and use it in GitHub Desktop.
This file contains 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
var done = function(err, image) { | |
console.log('before undefined foo-function'); | |
foo(); | |
console.log('after undefined foo-function'); | |
} | |
function readImage(src, done) { | |
var image = new Canvas.Image; | |
image.onerror = function(err){ | |
done(err); // makes subsequent errors silently ignored, console.log('image.onerror:', err); instead reports error to console | |
}; | |
image.onload = function() { | |
done(null, image); | |
}; | |
image.src = src; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment