DeveloperError. Using Check instead of explicit hand-coded conditionals is more concise. For example:if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
becomes
Check.typeOf.object('cartesian', cartesian);
Cartesian3 to use Check.We still want to update the rest of the Cesium codebase to use Check when reasonable (very specific checks for DeveloperErrors can still be hand-coded). This is a great beginner issue.
Core directory: cartesian, matrices, quaternions, etc.@exceptions is still correct and that there are unit tests for the exceptions in the corresponding Spec file (try the WebStorm plugin to flip between the source and spec file).@shehzan10
Matrix2Matrix4Cartesian4Spherical@austinEng
Matrix3Cartesian2QuaternionRectangleAll of these files are in the Core directory.
@WilliamKHo @moneimne @omh1280 @AnimatedRNG Let's work on these to start. Open a separate pull request for each file to start.
@rahwang would you like to do the first round of reviews for these?
All these files are in the Core directory. For any checks that involve arrays, just use Check.defined as there is not a Check.typeOf.array. Some checks may also require using Check.typeOf.number.lessThan and related functions.
@WilliamKHo
arrayRemoveDuplicatesAttributeCompression (fix any of the "____ is required" checks, skip others)AxisAlignedBoundingBoxbarycentricCoordinates@moneimne
binarySearchBingMapsGeocoderServiceBoxGeometryBoxOutlineGeometry@omh1280
Cartesian2 (fix just the "left and right are required" checks)Cartesian3 (fix just the "____ is required" checks)CartographicCartographicGeocoderService@AnimatedRNG
I'd be happy to @lilleyse !
@WilliamKHo @moneimne @omh1280
When you open a pull request for any of these, please tag. Ping if you need help!
@rms13
@Rudraksha20
Check.typeOf.number.equals function (#5555)
Most helpful comment
@WilliamKHo @moneimne @omh1280 @AnimatedRNG Let's work on these to start. Open a separate pull request for each file to start.
@rahwang would you like to do the first round of reviews for these?
All these files are in the
Coredirectory. For any checks that involve arrays, just useCheck.definedas there is not aCheck.typeOf.array. Some checks may also require usingCheck.typeOf.number.lessThanand related functions.@WilliamKHo
arrayRemoveDuplicatesAttributeCompression(fix any of the "____ is required" checks, skip others)AxisAlignedBoundingBoxbarycentricCoordinates@moneimne
binarySearchBingMapsGeocoderServiceBoxGeometryBoxOutlineGeometry@omh1280
Cartesian2(fix just the "left and right are required" checks)Cartesian3(fix just the "____ is required" checks)CartographicCartographicGeocoderService@AnimatedRNG