Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
prototype.loadImage = function(uri) {
var loader = this,
Image = image();
increment(loader);
return loader._loader
.sanitize(uri, {context: 'image'})
.then(function(opt) {
var url = opt.href;
if (!url || !Image) throw {url: url};
var img = new Image();
img.onload = function() {
decrement(loader);
};
img.onerror = function() {
decrement(loader);