Fix dynamic mixins with nested rules

Dynamic mixins with more than one level of nesting wouldn't work.
This is now fixed. Also refactored mixin.definition.eval a little.
This commit is contained in:
cloudhead
2010-04-22 13:07:41 -04:00
parent 1e0cfe9ac1
commit 25dbfb177a
5 changed files with 31 additions and 7 deletions

View File

@@ -7,6 +7,12 @@ tree.Ruleset = function Ruleset(selectors, rules) {
};
tree.Ruleset.prototype = {
eval: function () { return this },
evalRules: function (context) {
return new(tree.Ruleset)(this.selectors, this.rules.map(function (r) {
if (r.evalRules) return r.evalRules(context);
else return r.eval(context);
}));
},
variables: function () {
if (this._variables) { return this._variables }
else {