Improve type checking in ol.color

This commit is contained in:
Tom Payne
2013-11-18 12:13:09 +01:00
parent 4e3221810a
commit 2ecd4013ea

View File

@@ -211,7 +211,8 @@ ol.color.fromStringInternal_ = function(s) {
var isHex = false;
if (ol.color.ENABLE_NAMED_COLORS && goog.color.names.hasOwnProperty(s)) {
s = goog.color.names[s];
// goog.color.names does not have a type declaration, so add a typecast
s = /** @type {string} */ (goog.color.names[s]);
isHex = true;
}