Replace instanceof checks with other logic

This commit is contained in:
ahocevar
2018-10-05 16:16:51 +02:00
parent 96e99e481e
commit 9163558511
40 changed files with 232 additions and 268 deletions

View File

@@ -149,7 +149,7 @@ class Icon extends ImageStyle {
5); // `imgSize` must be set when `image` is provided
if ((src === undefined || src.length === 0) && image) {
src = image instanceof HTMLImageElement && image.src || getUid(image).toString();
src = /** @type {HTMLImageElement} */ (image).src || getUid(image).toString();
}
assert(src !== undefined && src.length > 0,
6); // A defined and non-empty `src` or `image` must be provided