app/assets/javascripts/DynamicScene/DataSourceCollection.js in cesium-0.19.0 vs app/assets/javascripts/DynamicScene/DataSourceCollection.js in cesium-0.20.0
- old
+ new
@@ -1,8 +1,9 @@
/*global define*/
-define(['Core/DeveloperError', 'Core/destroyObject', 'Core/Event'], function(
+define(['Core/DeveloperError', 'Core/defined', 'Core/destroyObject', 'Core/Event'], function(
DeveloperError,
+ defined,
destroyObject,
Event) {
"use strict";
/**
@@ -35,11 +36,11 @@
* @param {DataSource} dataSource The data source to add.
*
* @exception {DeveloperError} dataSource is required.
*/
DataSourceCollection.prototype.add = function(dataSource) {
- if (typeof dataSource === 'undefined') {
+ if (!defined(dataSource)) {
throw new DeveloperError('dataSource is required.');
}
this._dataSources.push(dataSource);
this.dataSourceAdded.raiseEvent(this, dataSource);
};
@@ -120,11 +121,11 @@
*
* @exception {DeveloperError} index is required.
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
DataSourceCollection.prototype.get = function(index) {
- if (typeof index === 'undefined') {
+ if (!defined(index)) {
throw new DeveloperError('index is required.');
}
return this._dataSources[index];
};
@@ -146,11 +147,11 @@
* If this object was destroyed, it should not be used; calling any function other than
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
*
* @memberof DataSourceCollection
*
- * @return {Boolean} true if this object was destroyed; otherwise, false.
+ * @returns {Boolean} true if this object was destroyed; otherwise, false.
*
* @see DataSourceCollection#destroy
*/
DataSourceCollection.prototype.isDestroyed = function() {
return false;
@@ -165,10 +166,10 @@
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
* assign the return value (<code>undefined</code>) to the object as done in the example.
*
* @memberof DataSourceCollection
*
- * @return {undefined}
+ * @returns {undefined}
*
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*
* @see DataSourceCollection#isDestroyed
*
\ No newline at end of file