diff --git a/src/define/class/attributes/build.js b/src/define/class/attributes/build.js index 5cf8015a..37dcc46c 100644 --- a/src/define/class/attributes/build.js +++ b/src/define/class/attributes/build.js @@ -4,12 +4,13 @@ /*#ifndef(UMD)*/ "use strict"; /*global _GpfClassDefinition*/ // Class definition -/*global _gpfDefineClassAttributesIsAttributeSpecification*/ // Check if member name is an attribute -/*global _GPF_DEFINE_CLASS_ATTRIBUTES_SPEFICIATION*/ // $attributes +/*global _gpfDefClassAttrIsAttributeSpecification*/ // Check if member name is an attribute +/*global _GPF_DEFINE_CLASS_ATTRIBUTES_SPECIFICATION*/ // $attributes /*#endif*/ -var _gpfDefineClassAttributesClassAddmemberToPrototype = _GpfClassDefinition.prototype._addMemberToPrototype, - _gpfDefineClassAttributesClassBuildPrototype = _GpfClassDefinition.prototype._buildPrototype; +var _gpfDefClassAttrClassAddmemberToPrototype = _GpfClassDefinition.prototype._addMemberToPrototype, + _gpfDefClassAttrClassBuildPrototype = _GpfClassDefinition.prototype._buildPrototype, + _gpfDefClassAttrClassMemberName = "$" + _GPF_DEFINE_CLASS_ATTRIBUTES_SPECIFICATION; Object.assign(_GpfClassDefinition.prototype, { @@ -19,30 +20,27 @@ Object.assign(_GpfClassDefinition.prototype, { _attributes: {}, _addAttributesFor: function (memberName, attributes) { - if (!this.hasOwnProperty(this._attributes)) { - this._attributes = {}; - } this._attributes[memberName] = attributes; }, /** @inheritdoc */ _addMemberToPrototype: function (newPrototype, memberName, value) { - var attributeName = _gpfDefineClassAttributesIsAttributeSpecification(memberName); + var attributeName = _gpfDefClassAttrIsAttributeSpecification(memberName); if (attributeName) { this._addAttributesFor(attributeName, value); } else { - _gpfDefineClassAttributesClassAddmemberToPrototype.call(this, newPrototype, memberName, value); + _gpfDefClassAttrClassAddmemberToPrototype.call(this, newPrototype, memberName, value); } }, /** @inheritdoc */ _buildPrototype: function (newPrototype) { - var classAttributesMember = "$" + _GPF_DEFINE_CLASS_ATTRIBUTES_SPEFICIATION, - classAttributes = this._initialDefinition[classAttributesMember]; + var classAttributes = this._initialDefinition[_gpfDefClassAttrClassMemberName]; + this._attributes = {}; if (classAttributes) { - this._addAttributesFor(classAttributesMember, classAttributes); + this._addAttributesFor(_gpfDefClassAttrClassMemberName, classAttributes); } - _gpfDefineClassAttributesClassBuildPrototype.call(this, newPrototype); + _gpfDefClassAttrClassBuildPrototype.call(this, newPrototype); } });