chafey/cornerstone — pull request #8 by jpambrun (2014-11-12 20:16:17+00:00)
Title: Fix #5 by rejecting imagepromise before the are discarded

Rejecting imagepromise before the are discarded fixes issue #5. The
then() function is never called and the cacheSizeInBytes is not set into
an incoherent state.

purgecache was modified for clarity. The loaded property of cachedImage
was added because it is used later and a typo was fixed.