From 6e22c810d0cecc5cd3392284d53712313ac79b06 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Thu, 25 Feb 2010 17:57:47 -0500 Subject: [PATCH] code style change in variable.js --- lib/less/node/variable.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/less/node/variable.js b/lib/less/node/variable.js index f642b7f..4ceb578 100644 --- a/lib/less/node/variable.js +++ b/lib/less/node/variable.js @@ -1,19 +1,21 @@ node.Variable = function Variable(name) { this.name = name }; -node.Variable.prototype.eval = function (env) { - var variables, variable; - for (var i = 0; i < env.frames.length; i++) { - variables = env.frames[i].variables(); +node.Variable.prototype = { + eval: function (env) { + var variables, variable; + for (var i = 0; i < env.frames.length; i++) { + variables = env.frames[i].variables(); - for (var j = 0; j < variables.length; j++) { - variable = variables[j]; + for (var j = 0; j < variables.length; j++) { + variable = variables[j]; - if (variable.name === this.name) { - if (variable.value.eval) { - return variable.value.eval(env); - } else { return variable.value } + if (variable.name === this.name) { + if (variable.value.eval) { + return variable.value.eval(env); + } else { return variable.value } + } } } + throw new(Error)("variable " + this.name + " is undefined"); } - throw new(Error)("variable " + this.name + " is undefined"); };