From 3883aa3c4211bce67b36380c1642a72c6e30b94d Mon Sep 17 00:00:00 2001 From: Anthropohedron Date: Sun, 19 Apr 2015 08:55:07 -0400 Subject: [PATCH] made it possible for actions to validate themselves --- lib/actions-impl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/actions-impl.js b/lib/actions-impl.js index fae2039..adfac2b 100644 --- a/lib/actions-impl.js +++ b/lib/actions-impl.js @@ -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 " + @@ -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") ?