Skip to content

Commit

Permalink
Adding the build hook (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Aug 28, 2018
1 parent 549ebd9 commit ec48732
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/define/class/attributes/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
/*global _gpfDefClassAttrIsAttributeSpecification*/ // Check if member name is an attribute
/*#endif*/

var _gpfDefClassAttrClassAddmemberToPrototype = _GpfClassDefinition.prototype._addMemberToPrototype;
var _gpfDefClassAttrClassAddmemberToPrototype = _GpfClassDefinition.prototype._addMemberToPrototype,
_gpfDefClassAttrClassBuildPrototype = _GpfClassDefinition.prototype._buildPrototype;

function _gpfDefClassAttrBuild (member, attribute, newPrototype) {
/*jshint validthis:true*/
attribute._build(member, this, newPrototype); //eslint-disable-line no-invalid-this
}

Object.assign(_GpfClassDefinition.prototype, {

Expand All @@ -31,6 +37,11 @@ Object.assign(_GpfClassDefinition.prototype, {
if (!attributeName) {
_gpfDefClassAttrClassAddmemberToPrototype.call(this, newPrototype, memberName, value);
}
},

_buildPrototype: function (newPrototype) {
_gpfDefClassAttrClassBuildPrototype.call(this, newPrototype);
this._forOwnAttributes(_gpfDefClassAttrBuild, newPrototype);
}

});

0 comments on commit ec48732

Please sign in to comment.