[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

@ -10,22 +10,17 @@ define(
* have a composition property.
* @constructor
* @memberof platform/containment
* @implements {Policy.<Type, Type>}
*/
function CompositionModelPolicy() {
return {
/**
* Is the type identified by the candidate allowed to
* contain the type described by the context?
* @memberof platform/containment.CompositionModelPolicy#
*/
allow: function (candidate, context) {
return Array.isArray(
(candidate.getInitialModel() || {}).composition
);
}
};
}
CompositionModelPolicy.prototype.allow = function (candidate, context) {
return Array.isArray(
(candidate.getInitialModel() || {}).composition
);
};
return CompositionModelPolicy;
}
);