Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/parse-srcset.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
}(this, function () {

// 1. Let input be the value passed to this algorithm.
return function (input) {
return function (input, onError) {

onError = onError || (typeof console !== "undefined" && console.log);

// UTILITY FUNCTIONS

Expand Down Expand Up @@ -320,8 +322,8 @@
if (d) { candidate.d = d;}
if (h) { candidate.h = h;}
candidates.push(candidate);
} else if (console && console.log) {
console.log("Invalid srcset descriptor found in '" +
} else if (onError) {
onError("Invalid srcset descriptor found in '" +
input + "' at '" + desc + "'.");
}
} // (close parseDescriptors fn)
Expand Down