mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
removed constructor names
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Alpha = function Alpha(val) {
|
||||
tree.Alpha = function (val) {
|
||||
this.value = val;
|
||||
};
|
||||
tree.Alpha.prototype = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Anonymous = function Anonymous(string) {
|
||||
tree.Anonymous = function (string) {
|
||||
this.value = string.content || string;
|
||||
};
|
||||
tree.Anonymous.prototype = {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// A function call node.
|
||||
//
|
||||
tree.Call = function Call(name, args) {
|
||||
tree.Call = function (name, args) {
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// RGB Colors - #ff0014, #eee
|
||||
//
|
||||
tree.Color = function Color(rgb, a) {
|
||||
tree.Color = function (rgb, a) {
|
||||
//
|
||||
// The end goal here, is to parse the arguments
|
||||
// into an integer triplet, such as `128, 255, 0`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Comment = function Comment(value, silent) {
|
||||
tree.Comment = function (value, silent) {
|
||||
this.value = value;
|
||||
this.silent = !!silent;
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
// A number with a unit
|
||||
//
|
||||
tree.Dimension = function Dimension(value, unit) {
|
||||
tree.Dimension = function (value, unit) {
|
||||
this.value = parseFloat(value);
|
||||
this.unit = unit || null;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Directive = function Directive(name, value) {
|
||||
tree.Directive = function (name, value) {
|
||||
this.name = name;
|
||||
if (Array.isArray(value)) {
|
||||
this.ruleset = new(tree.Ruleset)([], value);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Element = function Element(combinator, value) {
|
||||
tree.Element = function (combinator, value) {
|
||||
this.combinator = combinator instanceof tree.Combinator ?
|
||||
combinator : new(tree.Combinator)(combinator);
|
||||
this.value = value.trim();
|
||||
@@ -9,7 +9,7 @@ tree.Element.prototype.toCSS = function (env) {
|
||||
return this.combinator.toCSS(env || {}) + this.value;
|
||||
};
|
||||
|
||||
tree.Combinator = function Combinator(value) {
|
||||
tree.Combinator = function (value) {
|
||||
if (value === ' ') {
|
||||
this.value = ' ';
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Expression = function Expression(value) { this.value = value };
|
||||
tree.Expression = function (value) { this.value = value };
|
||||
tree.Expression.prototype = {
|
||||
eval: function (env) {
|
||||
if (this.value.length > 1) {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// `import,push`, we also pass it a callback, which it'll call once
|
||||
// the file has been fetched, and parsed.
|
||||
//
|
||||
tree.Import = function Import(path, imports) {
|
||||
tree.Import = function (path, imports) {
|
||||
var that = this;
|
||||
|
||||
this._path = path;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Keyword = function Keyword(value) { this.value = value };
|
||||
tree.Keyword = function (value) { this.value = value };
|
||||
tree.Keyword.prototype = {
|
||||
eval: function () { return this },
|
||||
toCSS: function () { return this.value }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.mixin = {};
|
||||
tree.mixin.Call = function MixinCall(elements, args, index) {
|
||||
tree.mixin.Call = function (elements, args, index) {
|
||||
this.selector = new(tree.Selector)(elements);
|
||||
this.arguments = args;
|
||||
this.index = index;
|
||||
@@ -40,7 +40,7 @@ tree.mixin.Call.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
tree.mixin.Definition = function MixinDefinition(name, params, rules) {
|
||||
tree.mixin.Definition = function (name, params, rules) {
|
||||
this.name = name;
|
||||
this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
|
||||
this.params = params;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Operation = function Operation(op, operands) {
|
||||
tree.Operation = function (op, operands) {
|
||||
this.op = op.trim();
|
||||
this.operands = operands;
|
||||
};
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Quoted = function Quoted(value, content) {
|
||||
tree.Quoted = function (value, content) {
|
||||
this.value = value;
|
||||
this.content = content;
|
||||
};
|
||||
tree.Quoted.prototype = {
|
||||
toCSS: function () {
|
||||
var css = this.value;
|
||||
return css;
|
||||
return this.value;
|
||||
},
|
||||
eval: function () {
|
||||
return this;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Rule = function Rule(name, value, index) {
|
||||
tree.Rule = function (name, value, index) {
|
||||
this.name = name;
|
||||
this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
|
||||
this.index = index;
|
||||
@@ -20,7 +20,7 @@ tree.Rule.prototype.eval = function (context) {
|
||||
return new(tree.Rule)(this.name, this.value.eval(context));
|
||||
};
|
||||
|
||||
tree.Shorthand = function Shorthand(a, b) {
|
||||
tree.Shorthand = function (a, b) {
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Ruleset = function Ruleset(selectors, rules) {
|
||||
tree.Ruleset = function (selectors, rules) {
|
||||
this.selectors = selectors;
|
||||
this.rules = rules;
|
||||
this._lookups = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Selector = function Selector(elements) {
|
||||
tree.Selector = function (elements) {
|
||||
this.elements = elements;
|
||||
if (this.elements[0].combinator.value === "") {
|
||||
this.elements[0].combinator.value = ' ';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.URL = function URL(val) {
|
||||
tree.URL = function (val) {
|
||||
this.value = val;
|
||||
};
|
||||
tree.URL.prototype = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Value = function Value(value) {
|
||||
tree.Value = function (value) {
|
||||
this.value = value;
|
||||
this.is = 'value';
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Variable = function Variable(name, index) { this.name = name, this.index = index };
|
||||
tree.Variable = function (name, index) { this.name = name, this.index = index };
|
||||
tree.Variable.prototype = {
|
||||
eval: function (env) {
|
||||
var variable, v, name = this.name;
|
||||
|
||||
Reference in New Issue
Block a user