Correct Typo, check with hasOwnProperty

Update warning message with correct wording, and change
check for label property such that a blank label will also
trigger the deprecation warning.

Addresses feedback from https://github.com/nasa/openmct/pull/1571
This commit is contained in:
Pete Richards 2017-05-10 14:39:47 -07:00
parent c5161887e2
commit 08a8207f64

View File

@ -63,10 +63,10 @@ define(['./Type'], function (Type) {
* @private
*/
TypeRegistry.prototype.standardizeType = function (typeDef) {
if (typeDef.label) {
if (typeDef.hasOwnProperty('label')) {
console.warn(
'DEPRECIATION WARNING typeDef: ' + typeDef.label + '. ' +
'`label` is depreciated in type definitions. Please use ' +
'DEPRECATION WARNING typeDef: ' + typeDef.label + '. ' +
'`label` is deprecated in type definitions. Please use ' +
'`name` instead. This will cause errors in a future version ' +
'of Open MCT. For more information, see ' +
'https://github.com/nasa/openmct/issues/1568');