lib/less/js/lib/less/tree/variable.js in less-2.3.3 vs lib/less/js/lib/less/tree/variable.js in less-2.4.0

- old
+ new

@@ -1,20 +1,21 @@ (function (tree) { -tree.Variable = function (name, index, file) { this.name = name, this.index = index, this.file = file }; +tree.Variable = function (name, index, currentFileInfo) { this.name = name, this.index = index, this.currentFileInfo = currentFileInfo }; tree.Variable.prototype = { + type: "Variable", eval: function (env) { var variable, v, name = this.name; if (name.indexOf('@@') == 0) { name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value; } if (this.evaluating) { throw { type: 'Name', message: "Recursive variable definition for " + name, - filename: this.file, + filename: this.currentFileInfo.file, index: this.index }; } this.evaluating = true; @@ -27,10 +28,10 @@ return variable; } else { throw { type: 'Name', message: "variable " + name + " is undefined", - filename: this.file, + filename: this.currentFileInfo.filename, index: this.index }; } } };