[Code Style] Use prototypes in containment bundle

WTD-1482.
This commit is contained in:
Victor Woeltjen
2015-08-11 11:01:13 -07:00
parent aa08db1050
commit f377c7cb71
6 changed files with 94 additions and 114 deletions

View File

@ -30,24 +30,18 @@ define(
* Disallow composition changes to objects which are not mutable.
* @memberof platform/containment
* @constructor
* @implements {Policy.<Type, Type>}
*/
function CompositionMutabilityPolicy() {
return {
/**
* Is the type identified by the candidate allowed to
* contain the type described by the context?
* @param {Type} candidate the type of domain object
* @memberof platform/containment.CompositionMutabilityPolicy#
*/
allow: function (candidate) {
// Equate creatability with mutability; that is, users
// can only modify objects of types they can create, and
// vice versa.
return candidate.hasFeature('creation');
}
};
}
CompositionMutabilityPolicy.prototype.allow = function (candidate) {
// Equate creatability with mutability; that is, users
// can only modify objects of types they can create, and
// vice versa.
return candidate.hasFeature('creation');
};
return CompositionMutabilityPolicy;
}
);