Replace 'throw new Error' by 'goog.asserts.fail'
This commit is contained in:
@@ -242,7 +242,7 @@ ol.color.fromStringInternal_ = function(s) {
|
||||
color = [r, g, b, 1];
|
||||
return ol.color.normalize(color, color);
|
||||
} else {
|
||||
throw new Error(s + ' is not a valid color');
|
||||
goog.asserts.fail(s + ' is not a valid color');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -57,7 +57,7 @@ ol.geom.SimpleGeometry.getLayoutForStride_ = function(stride) {
|
||||
} else if (stride == 4) {
|
||||
return ol.geom.GeometryLayout.XYZM;
|
||||
} else {
|
||||
throw new Error('unsupported stride: ' + stride);
|
||||
goog.asserts.fail('unsupported stride: ' + stride);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ ol.geom.SimpleGeometry.getStrideForLayout_ = function(layout) {
|
||||
} else if (layout == ol.geom.GeometryLayout.XYZM) {
|
||||
return 4;
|
||||
} else {
|
||||
throw new Error('unsupported layout: ' + layout);
|
||||
goog.asserts.fail('unsupported layout: ' + layout);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user