(minor) tidying up

This commit is contained in:
Alexis Sellier
2012-01-03 18:46:28 +01:00
parent 5ec708c3f4
commit 2844e03c5b
2 changed files with 7 additions and 3 deletions

View File

@@ -1,13 +1,17 @@
require('./tree').find = function (obj, fun) {
(function (tree) {
tree.find = function (obj, fun) {
for (var i = 0, r; i < obj.length; i++) {
if (r = fun.call(obj, obj[i])) { return r }
}
return null;
};
require('./tree').jsify = function (obj) {
tree.jsify = function (obj) {
if (Array.isArray(obj.value) && (obj.value.length > 1)) {
return '[' + obj.value.map(function (v) { return v.toCSS(false) }).join(', ') + ']';
} else {
return obj.toCSS(false);
}
};
})(require('./tree'));

View File

@@ -121,7 +121,7 @@ tree.Ruleset.prototype = {
if (context.length === 0) {
paths = this.selectors.map(function (s) { return [s] });
} else {
this.joinSelectors( paths, context, this.selectors );
this.joinSelectors(paths, context, this.selectors);
}
}