Improve type checking in ol.color.fromString
This commit is contained in:
@@ -142,7 +142,11 @@ ol.color.equals = function(color1, color2) {
|
|||||||
* @param {ol.Color=} opt_color Color.
|
* @param {ol.Color=} opt_color Color.
|
||||||
* @return {ol.Color} Color.
|
* @return {ol.Color} Color.
|
||||||
*/
|
*/
|
||||||
ol.color.fromString = (function() {
|
ol.color.fromString = (
|
||||||
|
/**
|
||||||
|
* @return {function(string, ol.Color=): ol.Color}
|
||||||
|
*/
|
||||||
|
function() {
|
||||||
|
|
||||||
// We maintain a small cache of parsed strings. To provide cheap LRU-like
|
// We maintain a small cache of parsed strings. To provide cheap LRU-like
|
||||||
// semantics, whenever the cache grows too large we simply delete an
|
// semantics, whenever the cache grows too large we simply delete an
|
||||||
@@ -191,7 +195,7 @@ ol.color.fromString = (function() {
|
|||||||
return ol.color.returnOrUpdate(color, opt_color);
|
return ol.color.returnOrUpdate(color, opt_color);
|
||||||
});
|
});
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user