diff --git a/lib/less/tree/mixin.js b/lib/less/tree/mixin.js index 11229b2..c34a288 100644 --- a/lib/less/tree/mixin.js +++ b/lib/less/tree/mixin.js @@ -52,6 +52,7 @@ tree.mixin.Definition = function (name, params, rules) { else { return count } }, 0); this.parent = tree.Ruleset.prototype; + this.frames = []; }; tree.mixin.Definition.prototype = { toCSS: function () { return "" }, @@ -73,7 +74,7 @@ tree.mixin.Definition.prototype = { } } return new(tree.Ruleset)(null, this.rules).evalRules({ - frames: [this, frame].concat(env.frames) + frames: [this, frame].concat(this.frames, env.frames) }); }, match: function (args, env) { diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js index 51323e5..745a48e 100644 --- a/lib/less/tree/ruleset.js +++ b/lib/less/tree/ruleset.js @@ -108,6 +108,8 @@ tree.Ruleset.prototype = { if (this.rules[i] instanceof tree.mixin.Call) { Array.prototype.splice .apply(this.rules, [i, 1].concat(this.rules[i].eval(env))); + } else if (this.rules[i] instanceof tree.mixin.Definition) { + this.rules[i].frames = env.frames.slice(0); } }