From c7cf1e3baae68ad95f8664d49051ac037bfd26bf Mon Sep 17 00:00:00 2001 From: Srinivas Kaza Date: Mon, 5 Jun 2017 16:16:22 -0400 Subject: [PATCH 1/2] Replaces most DeveloperError(s) with Check(s) in Geometry --- Source/Core/Geometry.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/Core/Geometry.js b/Source/Core/Geometry.js index 17b5065f0692..418ef2f44b8c 100644 --- a/Source/Core/Geometry.js +++ b/Source/Core/Geometry.js @@ -1,11 +1,13 @@ /*global define*/ define([ + './Check', './defaultValue', './defined', './DeveloperError', './GeometryType', './PrimitiveType' ], function( + Check, defaultValue, defined, DeveloperError, @@ -67,10 +69,8 @@ define([ options = defaultValue(options, defaultValue.EMPTY_OBJECT); //>>includeStart('debug', pragmas.debug); - if (!defined(options.attributes)) { - throw new DeveloperError('options.attributes is required.'); - } //>>includeEnd('debug'); + Check.defined('options.attributes', options.attributes); /** * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a @@ -173,10 +173,8 @@ define([ */ Geometry.computeNumberOfVertices = function(geometry) { //>>includeStart('debug', pragmas.debug); - if (!defined(geometry)) { - throw new DeveloperError('geometry is required.'); - } //>>includeEnd('debug'); + Check.defined('geometry', geometry); var numberOfVertices = -1; for ( var property in geometry.attributes) { From f697b266a6f4bc66249ba031f2e07e067959f546 Mon Sep 17 00:00:00 2001 From: Srinivas Kaza Date: Mon, 5 Jun 2017 17:18:08 -0400 Subject: [PATCH 2/2] Fixes --- Source/Core/Geometry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Geometry.js b/Source/Core/Geometry.js index 418ef2f44b8c..51a4e5502b60 100644 --- a/Source/Core/Geometry.js +++ b/Source/Core/Geometry.js @@ -69,8 +69,8 @@ define([ options = defaultValue(options, defaultValue.EMPTY_OBJECT); //>>includeStart('debug', pragmas.debug); + Check.typeOf.object('options.attributes', options.attributes); //>>includeEnd('debug'); - Check.defined('options.attributes', options.attributes); /** * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a @@ -173,8 +173,8 @@ define([ */ Geometry.computeNumberOfVertices = function(geometry) { //>>includeStart('debug', pragmas.debug); + Check.typeOf.object('geometry', geometry); //>>includeEnd('debug'); - Check.defined('geometry', geometry); var numberOfVertices = -1; for ( var property in geometry.attributes) {