/usr/lib/nodejs/less/tree/rule.js is in node-less 1.4.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | (function (tree) {
tree.Rule = function (name, value, important, index, currentFileInfo, inline) {
this.name = name;
this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
this.important = important ? ' ' + important.trim() : '';
this.index = index;
this.currentFileInfo = currentFileInfo;
this.inline = inline || false;
if (name.charAt(0) === '@') {
this.variable = true;
} else { this.variable = false }
};
tree.Rule.prototype = {
type: "Rule",
accept: function (visitor) {
this.value = visitor.visit(this.value);
},
toCSS: function (env) {
if (this.variable) { return "" }
else {
try {
return this.name + (env.compress ? ':' : ': ') +
this.value.toCSS(env) +
this.important + (this.inline ? "" : ";");
}
catch(e) {
e.index = this.index;
e.filename = this.currentFileInfo.filename;
throw e;
}
}
},
eval: function (env) {
var strictMathBypass = false;
if (this.name === "font" && !env.strictMath) {
strictMathBypass = true;
env.strictMath = true;
}
try {
return new(tree.Rule)(this.name,
this.value.eval(env),
this.important,
this.index, this.currentFileInfo, this.inline);
}
finally {
if (strictMathBypass) {
env.strictMath = false;
}
}
},
makeImportant: function () {
return new(tree.Rule)(this.name,
this.value,
"!important",
this.index, this.currentFileInfo, this.inline);
}
};
})(require('../tree'));
|