Skip to content

Commit

Permalink
made it possible for actions to validate themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthropohedron committed Apr 19, 2015
1 parent 3b57903 commit 3883aa3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/actions-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function AbstractAction(Class, props) {
}
}
AbstractAction.prototype = {
validate: function validate() { return true; },
actOnRequest: function unimplementedOnRequest() {
if (this.unimplemented) { return; }
throw new Error("Attempted to call unimplemented " +
Expand All @@ -55,7 +56,7 @@ var boolActionTpl = [
var paramActionTpl = [
"(function() { return function ",
null,
"(param) { this.param = param; }; }());"
"(param) { this.param = param; this.validate(); }; }());"
];
function implementAction(action, classProps, instanceProps) {
var fnTpl = (classProps.type === "bool") ?
Expand Down

0 comments on commit 3883aa3

Please sign in to comment.