From 88d22c0164f25515d9e0cffde3ebb13530425ecf Mon Sep 17 00:00:00 2001 From: Mithun Satheesh Date: Fri, 15 Feb 2013 19:57:09 +0530 Subject: [PATCH] Update lib/jools.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit extra variable not needed in the context.  --- lib/jools.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/jools.js b/lib/jools.js index 98582e4..7eb56dc 100644 --- a/lib/jools.js +++ b/lib/jools.js @@ -28,10 +28,9 @@ function Jools(rules) { * * @param {Object} fact */ -Jools.prototype.execute = function (fact) { - var self = this - , session = _.clone(fact) - , last_session = _.clone(fact) +Jools.prototype.execute = function (session) { + + var last_session = _.clone(session) , goal = false; while (!goal) { @@ -52,7 +51,7 @@ Jools.prototype.execute = function (fact) { if (outcome) { _.flatten([rule.consequence]).forEach(function (csq) { csq.__args = csq.__args || utils.paramNames(csq); - csq.apply(session, utils.paramsToArguments(fact, csq.__args)); + csq.apply(session, utils.paramsToArguments(session, csq.__args)); if (!_.isEqual(last_session,session)) { // Fire all rules again! changes = true;