mirror of
https://github.com/less/less.js.git
synced 2026-01-21 05:08:10 -05:00
move the visitors to return themselves instead of assuming where they live
This commit is contained in:
@@ -21,7 +21,7 @@ function log(str, level) {
|
||||
|
||||
var isFileProtocol = /^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);
|
||||
|
||||
less.environment = require("./environments/browser.js")(less, isFileProtocol, log, logLevel);
|
||||
less.environment = require("./environment/browser.js")(less, isFileProtocol, log, logLevel);
|
||||
window.less = less;
|
||||
|
||||
less.env = options.env || (location.hostname == '127.0.0.1' ||
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
module.exports = function (tree) {
|
||||
tree.colors = {
|
||||
'aliceblue':'#f0f8ff',
|
||||
'antiquewhite':'#faebd7',
|
||||
'aqua':'#00ffff',
|
||||
'aquamarine':'#7fffd4',
|
||||
'azure':'#f0ffff',
|
||||
'beige':'#f5f5dc',
|
||||
'bisque':'#ffe4c4',
|
||||
'black':'#000000',
|
||||
'blanchedalmond':'#ffebcd',
|
||||
'blue':'#0000ff',
|
||||
'blueviolet':'#8a2be2',
|
||||
'brown':'#a52a2a',
|
||||
'burlywood':'#deb887',
|
||||
'cadetblue':'#5f9ea0',
|
||||
'chartreuse':'#7fff00',
|
||||
'chocolate':'#d2691e',
|
||||
'coral':'#ff7f50',
|
||||
'cornflowerblue':'#6495ed',
|
||||
'cornsilk':'#fff8dc',
|
||||
'crimson':'#dc143c',
|
||||
'cyan':'#00ffff',
|
||||
'darkblue':'#00008b',
|
||||
'darkcyan':'#008b8b',
|
||||
'darkgoldenrod':'#b8860b',
|
||||
'darkgray':'#a9a9a9',
|
||||
'darkgrey':'#a9a9a9',
|
||||
'darkgreen':'#006400',
|
||||
'darkkhaki':'#bdb76b',
|
||||
'darkmagenta':'#8b008b',
|
||||
'darkolivegreen':'#556b2f',
|
||||
'darkorange':'#ff8c00',
|
||||
'darkorchid':'#9932cc',
|
||||
'darkred':'#8b0000',
|
||||
'darksalmon':'#e9967a',
|
||||
'darkseagreen':'#8fbc8f',
|
||||
'darkslateblue':'#483d8b',
|
||||
'darkslategray':'#2f4f4f',
|
||||
'darkslategrey':'#2f4f4f',
|
||||
'darkturquoise':'#00ced1',
|
||||
'darkviolet':'#9400d3',
|
||||
'deeppink':'#ff1493',
|
||||
'deepskyblue':'#00bfff',
|
||||
'dimgray':'#696969',
|
||||
'dimgrey':'#696969',
|
||||
'dodgerblue':'#1e90ff',
|
||||
'firebrick':'#b22222',
|
||||
'floralwhite':'#fffaf0',
|
||||
'forestgreen':'#228b22',
|
||||
'fuchsia':'#ff00ff',
|
||||
'gainsboro':'#dcdcdc',
|
||||
'ghostwhite':'#f8f8ff',
|
||||
'gold':'#ffd700',
|
||||
'goldenrod':'#daa520',
|
||||
'gray':'#808080',
|
||||
'grey':'#808080',
|
||||
'green':'#008000',
|
||||
'greenyellow':'#adff2f',
|
||||
'honeydew':'#f0fff0',
|
||||
'hotpink':'#ff69b4',
|
||||
'indianred':'#cd5c5c',
|
||||
'indigo':'#4b0082',
|
||||
'ivory':'#fffff0',
|
||||
'khaki':'#f0e68c',
|
||||
'lavender':'#e6e6fa',
|
||||
'lavenderblush':'#fff0f5',
|
||||
'lawngreen':'#7cfc00',
|
||||
'lemonchiffon':'#fffacd',
|
||||
'lightblue':'#add8e6',
|
||||
'lightcoral':'#f08080',
|
||||
'lightcyan':'#e0ffff',
|
||||
'lightgoldenrodyellow':'#fafad2',
|
||||
'lightgray':'#d3d3d3',
|
||||
'lightgrey':'#d3d3d3',
|
||||
'lightgreen':'#90ee90',
|
||||
'lightpink':'#ffb6c1',
|
||||
'lightsalmon':'#ffa07a',
|
||||
'lightseagreen':'#20b2aa',
|
||||
'lightskyblue':'#87cefa',
|
||||
'lightslategray':'#778899',
|
||||
'lightslategrey':'#778899',
|
||||
'lightsteelblue':'#b0c4de',
|
||||
'lightyellow':'#ffffe0',
|
||||
'lime':'#00ff00',
|
||||
'limegreen':'#32cd32',
|
||||
'linen':'#faf0e6',
|
||||
'magenta':'#ff00ff',
|
||||
'maroon':'#800000',
|
||||
'mediumaquamarine':'#66cdaa',
|
||||
'mediumblue':'#0000cd',
|
||||
'mediumorchid':'#ba55d3',
|
||||
'mediumpurple':'#9370d8',
|
||||
'mediumseagreen':'#3cb371',
|
||||
'mediumslateblue':'#7b68ee',
|
||||
'mediumspringgreen':'#00fa9a',
|
||||
'mediumturquoise':'#48d1cc',
|
||||
'mediumvioletred':'#c71585',
|
||||
'midnightblue':'#191970',
|
||||
'mintcream':'#f5fffa',
|
||||
'mistyrose':'#ffe4e1',
|
||||
'moccasin':'#ffe4b5',
|
||||
'navajowhite':'#ffdead',
|
||||
'navy':'#000080',
|
||||
'oldlace':'#fdf5e6',
|
||||
'olive':'#808000',
|
||||
'olivedrab':'#6b8e23',
|
||||
'orange':'#ffa500',
|
||||
'orangered':'#ff4500',
|
||||
'orchid':'#da70d6',
|
||||
'palegoldenrod':'#eee8aa',
|
||||
'palegreen':'#98fb98',
|
||||
'paleturquoise':'#afeeee',
|
||||
'palevioletred':'#d87093',
|
||||
'papayawhip':'#ffefd5',
|
||||
'peachpuff':'#ffdab9',
|
||||
'peru':'#cd853f',
|
||||
'pink':'#ffc0cb',
|
||||
'plum':'#dda0dd',
|
||||
'powderblue':'#b0e0e6',
|
||||
'purple':'#800080',
|
||||
'red':'#ff0000',
|
||||
'rosybrown':'#bc8f8f',
|
||||
'royalblue':'#4169e1',
|
||||
'saddlebrown':'#8b4513',
|
||||
'salmon':'#fa8072',
|
||||
'sandybrown':'#f4a460',
|
||||
'seagreen':'#2e8b57',
|
||||
'seashell':'#fff5ee',
|
||||
'sienna':'#a0522d',
|
||||
'silver':'#c0c0c0',
|
||||
'skyblue':'#87ceeb',
|
||||
'slateblue':'#6a5acd',
|
||||
'slategray':'#708090',
|
||||
'slategrey':'#708090',
|
||||
'snow':'#fffafa',
|
||||
'springgreen':'#00ff7f',
|
||||
'steelblue':'#4682b4',
|
||||
'tan':'#d2b48c',
|
||||
'teal':'#008080',
|
||||
'thistle':'#d8bfd8',
|
||||
'tomato':'#ff6347',
|
||||
'turquoise':'#40e0d0',
|
||||
'violet':'#ee82ee',
|
||||
'wheat':'#f5deb3',
|
||||
'white':'#ffffff',
|
||||
'whitesmoke':'#f5f5f5',
|
||||
'yellow':'#ffff00',
|
||||
'yellowgreen':'#9acd32'
|
||||
};
|
||||
};
|
||||
149
lib/less/data/colors.js
Normal file
149
lib/less/data/colors.js
Normal file
@@ -0,0 +1,149 @@
|
||||
module.exports = {
|
||||
'aliceblue':'#f0f8ff',
|
||||
'antiquewhite':'#faebd7',
|
||||
'aqua':'#00ffff',
|
||||
'aquamarine':'#7fffd4',
|
||||
'azure':'#f0ffff',
|
||||
'beige':'#f5f5dc',
|
||||
'bisque':'#ffe4c4',
|
||||
'black':'#000000',
|
||||
'blanchedalmond':'#ffebcd',
|
||||
'blue':'#0000ff',
|
||||
'blueviolet':'#8a2be2',
|
||||
'brown':'#a52a2a',
|
||||
'burlywood':'#deb887',
|
||||
'cadetblue':'#5f9ea0',
|
||||
'chartreuse':'#7fff00',
|
||||
'chocolate':'#d2691e',
|
||||
'coral':'#ff7f50',
|
||||
'cornflowerblue':'#6495ed',
|
||||
'cornsilk':'#fff8dc',
|
||||
'crimson':'#dc143c',
|
||||
'cyan':'#00ffff',
|
||||
'darkblue':'#00008b',
|
||||
'darkcyan':'#008b8b',
|
||||
'darkgoldenrod':'#b8860b',
|
||||
'darkgray':'#a9a9a9',
|
||||
'darkgrey':'#a9a9a9',
|
||||
'darkgreen':'#006400',
|
||||
'darkkhaki':'#bdb76b',
|
||||
'darkmagenta':'#8b008b',
|
||||
'darkolivegreen':'#556b2f',
|
||||
'darkorange':'#ff8c00',
|
||||
'darkorchid':'#9932cc',
|
||||
'darkred':'#8b0000',
|
||||
'darksalmon':'#e9967a',
|
||||
'darkseagreen':'#8fbc8f',
|
||||
'darkslateblue':'#483d8b',
|
||||
'darkslategray':'#2f4f4f',
|
||||
'darkslategrey':'#2f4f4f',
|
||||
'darkturquoise':'#00ced1',
|
||||
'darkviolet':'#9400d3',
|
||||
'deeppink':'#ff1493',
|
||||
'deepskyblue':'#00bfff',
|
||||
'dimgray':'#696969',
|
||||
'dimgrey':'#696969',
|
||||
'dodgerblue':'#1e90ff',
|
||||
'firebrick':'#b22222',
|
||||
'floralwhite':'#fffaf0',
|
||||
'forestgreen':'#228b22',
|
||||
'fuchsia':'#ff00ff',
|
||||
'gainsboro':'#dcdcdc',
|
||||
'ghostwhite':'#f8f8ff',
|
||||
'gold':'#ffd700',
|
||||
'goldenrod':'#daa520',
|
||||
'gray':'#808080',
|
||||
'grey':'#808080',
|
||||
'green':'#008000',
|
||||
'greenyellow':'#adff2f',
|
||||
'honeydew':'#f0fff0',
|
||||
'hotpink':'#ff69b4',
|
||||
'indianred':'#cd5c5c',
|
||||
'indigo':'#4b0082',
|
||||
'ivory':'#fffff0',
|
||||
'khaki':'#f0e68c',
|
||||
'lavender':'#e6e6fa',
|
||||
'lavenderblush':'#fff0f5',
|
||||
'lawngreen':'#7cfc00',
|
||||
'lemonchiffon':'#fffacd',
|
||||
'lightblue':'#add8e6',
|
||||
'lightcoral':'#f08080',
|
||||
'lightcyan':'#e0ffff',
|
||||
'lightgoldenrodyellow':'#fafad2',
|
||||
'lightgray':'#d3d3d3',
|
||||
'lightgrey':'#d3d3d3',
|
||||
'lightgreen':'#90ee90',
|
||||
'lightpink':'#ffb6c1',
|
||||
'lightsalmon':'#ffa07a',
|
||||
'lightseagreen':'#20b2aa',
|
||||
'lightskyblue':'#87cefa',
|
||||
'lightslategray':'#778899',
|
||||
'lightslategrey':'#778899',
|
||||
'lightsteelblue':'#b0c4de',
|
||||
'lightyellow':'#ffffe0',
|
||||
'lime':'#00ff00',
|
||||
'limegreen':'#32cd32',
|
||||
'linen':'#faf0e6',
|
||||
'magenta':'#ff00ff',
|
||||
'maroon':'#800000',
|
||||
'mediumaquamarine':'#66cdaa',
|
||||
'mediumblue':'#0000cd',
|
||||
'mediumorchid':'#ba55d3',
|
||||
'mediumpurple':'#9370d8',
|
||||
'mediumseagreen':'#3cb371',
|
||||
'mediumslateblue':'#7b68ee',
|
||||
'mediumspringgreen':'#00fa9a',
|
||||
'mediumturquoise':'#48d1cc',
|
||||
'mediumvioletred':'#c71585',
|
||||
'midnightblue':'#191970',
|
||||
'mintcream':'#f5fffa',
|
||||
'mistyrose':'#ffe4e1',
|
||||
'moccasin':'#ffe4b5',
|
||||
'navajowhite':'#ffdead',
|
||||
'navy':'#000080',
|
||||
'oldlace':'#fdf5e6',
|
||||
'olive':'#808000',
|
||||
'olivedrab':'#6b8e23',
|
||||
'orange':'#ffa500',
|
||||
'orangered':'#ff4500',
|
||||
'orchid':'#da70d6',
|
||||
'palegoldenrod':'#eee8aa',
|
||||
'palegreen':'#98fb98',
|
||||
'paleturquoise':'#afeeee',
|
||||
'palevioletred':'#d87093',
|
||||
'papayawhip':'#ffefd5',
|
||||
'peachpuff':'#ffdab9',
|
||||
'peru':'#cd853f',
|
||||
'pink':'#ffc0cb',
|
||||
'plum':'#dda0dd',
|
||||
'powderblue':'#b0e0e6',
|
||||
'purple':'#800080',
|
||||
'red':'#ff0000',
|
||||
'rosybrown':'#bc8f8f',
|
||||
'royalblue':'#4169e1',
|
||||
'saddlebrown':'#8b4513',
|
||||
'salmon':'#fa8072',
|
||||
'sandybrown':'#f4a460',
|
||||
'seagreen':'#2e8b57',
|
||||
'seashell':'#fff5ee',
|
||||
'sienna':'#a0522d',
|
||||
'silver':'#c0c0c0',
|
||||
'skyblue':'#87ceeb',
|
||||
'slateblue':'#6a5acd',
|
||||
'slategray':'#708090',
|
||||
'slategrey':'#708090',
|
||||
'snow':'#fffafa',
|
||||
'springgreen':'#00ff7f',
|
||||
'steelblue':'#4682b4',
|
||||
'tan':'#d2b48c',
|
||||
'teal':'#008080',
|
||||
'thistle':'#d8bfd8',
|
||||
'tomato':'#ff6347',
|
||||
'turquoise':'#40e0d0',
|
||||
'violet':'#ee82ee',
|
||||
'wheat':'#f5deb3',
|
||||
'white':'#ffffff',
|
||||
'whitesmoke':'#f5f5f5',
|
||||
'yellow':'#ffff00',
|
||||
'yellowgreen':'#9acd32'
|
||||
};
|
||||
@@ -1,13 +1,13 @@
|
||||
module.exports = function (tree) {
|
||||
/*jshint loopfunc:true */
|
||||
|
||||
tree.extendFinderVisitor = function() {
|
||||
var extendFinderVisitor = function() {
|
||||
this._visitor = new tree.visitor(this);
|
||||
this.contexts = [];
|
||||
this.allExtendsStack = [[]];
|
||||
};
|
||||
|
||||
tree.extendFinderVisitor.prototype = {
|
||||
extendFinderVisitor.prototype = {
|
||||
run: function (root) {
|
||||
root = this._visitor.visit(root);
|
||||
root.allExtends = this.allExtendsStack[0];
|
||||
@@ -85,13 +85,13 @@ module.exports = function (tree) {
|
||||
}
|
||||
};
|
||||
|
||||
tree.processExtendsVisitor = function() {
|
||||
var processExtendsVisitor = function() {
|
||||
this._visitor = new tree.visitor(this);
|
||||
};
|
||||
|
||||
tree.processExtendsVisitor.prototype = {
|
||||
processExtendsVisitor.prototype = {
|
||||
run: function(root) {
|
||||
var extendFinder = new tree.extendFinderVisitor();
|
||||
var extendFinder = new extendFinderVisitor();
|
||||
extendFinder.run(root);
|
||||
if (!extendFinder.foundExtends) { return root; }
|
||||
root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));
|
||||
@@ -413,4 +413,5 @@ module.exports = function (tree) {
|
||||
}
|
||||
};
|
||||
|
||||
return processExtendsVisitor;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module.exports = function (tree) {
|
||||
tree.importVisitor = function(importer, finish, evalEnv, onceFileDetectionMap, recursionDetector) {
|
||||
var importVisitor = function(importer, finish, evalEnv, onceFileDetectionMap, recursionDetector) {
|
||||
this._visitor = new tree.visitor(this);
|
||||
this._importer = importer;
|
||||
this._finish = finish;
|
||||
@@ -16,7 +16,7 @@ module.exports = function (tree) {
|
||||
}
|
||||
};
|
||||
|
||||
tree.importVisitor.prototype = {
|
||||
importVisitor.prototype = {
|
||||
isReplacing: true,
|
||||
run: function (root) {
|
||||
var error;
|
||||
@@ -138,5 +138,5 @@ module.exports = function (tree) {
|
||||
this.env.frames.shift();
|
||||
}
|
||||
};
|
||||
|
||||
return importVisitor;
|
||||
};
|
||||
|
||||
@@ -90,6 +90,6 @@ less.writeError = function (ctx, options) {
|
||||
console.error(less.formatError(ctx, options));
|
||||
};
|
||||
|
||||
less.environment = require("./environments/node");
|
||||
less.environment = require("./environment/node");
|
||||
|
||||
module.exports = less;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module.exports = function (tree) {
|
||||
tree.joinSelectorVisitor = function() {
|
||||
module.exports = function (visitor) {
|
||||
var joinSelectorVisitor = function() {
|
||||
this.contexts = [[]];
|
||||
this._visitor = new tree.visitor(this);
|
||||
this._visitor = new visitor(this);
|
||||
};
|
||||
|
||||
tree.joinSelectorVisitor.prototype = {
|
||||
joinSelectorVisitor.prototype = {
|
||||
run: function (root) {
|
||||
return this._visitor.visit(root);
|
||||
},
|
||||
@@ -40,5 +40,6 @@ module.exports = function (tree) {
|
||||
mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return joinSelectorVisitor;
|
||||
};
|
||||
@@ -1,5 +1,8 @@
|
||||
var less = {
|
||||
version: [1, 6, 3]
|
||||
version: [1, 6, 3],
|
||||
data: {
|
||||
colors: require('./data/colors')
|
||||
}
|
||||
};
|
||||
|
||||
less.tree = (require('./tree'))(less);
|
||||
@@ -7,12 +10,12 @@ less.Parser = (require('./parser'))(less, less.tree);
|
||||
less.tree.functions = (require('./functions'))(less, less.tree);
|
||||
require('./env')(less.tree);
|
||||
|
||||
require('./colors')(less.tree);
|
||||
require('./visitor.js')(less.tree);
|
||||
require('./import-visitor.js')(less.tree);
|
||||
require('./extend-visitor.js')(less.tree);
|
||||
require('./join-selector-visitor.js')(less.tree);
|
||||
require('./to-css-visitor.js')(less.tree);
|
||||
require('./source-map-output.js')(less, less.tree);
|
||||
less.tree.visitor = require('./visitor.js')(less.tree);
|
||||
less.tree.importVisitor = require('./import-visitor.js')(less.tree);
|
||||
less.tree.extendVisitor = require('./extend-visitor.js')(less.tree);
|
||||
less.tree.joinSelectorVisitor = require('./join-selector-visitor.js')(less.tree.visitor);
|
||||
less.tree.toCSSVisitor = require('./to-css-visitor.js')(less.tree);
|
||||
|
||||
less.tree.sourceMapOutput = require('./source-map-output.js')(less);
|
||||
|
||||
module.exports = less;
|
||||
|
||||
@@ -558,7 +558,7 @@ var Parser = function Parser(env) {
|
||||
var preEvalVisitors = [],
|
||||
visitors = [
|
||||
new(tree.joinSelectorVisitor)(),
|
||||
new(tree.processExtendsVisitor)(),
|
||||
new(tree.extendVisitor)(),
|
||||
new(tree.toCSSVisitor)({compress: Boolean(options.compress)})
|
||||
], i, root = this;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = function (less, tree) {
|
||||
module.exports = function (less) {
|
||||
|
||||
tree.sourceMapOutput = function (options) {
|
||||
var sourceMapOutput = function (options) {
|
||||
this._css = [];
|
||||
this._rootNode = options.rootNode;
|
||||
this._writeSourceMap = options.writeSourceMap;
|
||||
@@ -24,7 +24,7 @@ module.exports = function (less, tree) {
|
||||
this._column = 0;
|
||||
};
|
||||
|
||||
tree.sourceMapOutput.prototype.normalizeFilename = function(filename) {
|
||||
sourceMapOutput.prototype.normalizeFilename = function(filename) {
|
||||
filename = filename.replace(/\\/g, '/');
|
||||
|
||||
if (this._sourceMapBasepath && filename.indexOf(this._sourceMapBasepath) === 0) {
|
||||
@@ -36,7 +36,7 @@ module.exports = function (less, tree) {
|
||||
return (this._sourceMapRootpath || "") + filename;
|
||||
};
|
||||
|
||||
tree.sourceMapOutput.prototype.add = function(chunk, fileInfo, index, mapLines) {
|
||||
sourceMapOutput.prototype.add = function(chunk, fileInfo, index, mapLines) {
|
||||
|
||||
//ignore adding empty strings
|
||||
if (!chunk) {
|
||||
@@ -92,11 +92,11 @@ module.exports = function (less, tree) {
|
||||
this._css.push(chunk);
|
||||
};
|
||||
|
||||
tree.sourceMapOutput.prototype.isEmpty = function() {
|
||||
sourceMapOutput.prototype.isEmpty = function() {
|
||||
return this._css.length === 0;
|
||||
};
|
||||
|
||||
tree.sourceMapOutput.prototype.toCSS = function(env) {
|
||||
sourceMapOutput.prototype.toCSS = function(env) {
|
||||
this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });
|
||||
|
||||
if (this._outputSourceFiles) {
|
||||
@@ -138,4 +138,5 @@ module.exports = function (less, tree) {
|
||||
return this._css.join('');
|
||||
};
|
||||
|
||||
return sourceMapOutput;
|
||||
};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module.exports = function (tree) {
|
||||
tree.toCSSVisitor = function(env) {
|
||||
var toCSSVisitor = function(env) {
|
||||
this._visitor = new tree.visitor(this);
|
||||
this._env = env;
|
||||
};
|
||||
|
||||
tree.toCSSVisitor.prototype = {
|
||||
toCSSVisitor.prototype = {
|
||||
isReplacing: true,
|
||||
run: function (root) {
|
||||
return this._visitor.visit(root);
|
||||
@@ -236,4 +236,6 @@ module.exports = function (tree) {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return toCSSVisitor;
|
||||
};
|
||||
|
||||
@@ -97,7 +97,7 @@ tree.outputRuleset = function (env, output, rules) {
|
||||
};
|
||||
|
||||
tree.Alpha = require('./tree/alpha')(tree);
|
||||
tree.Color = require('./tree/color')(tree);
|
||||
tree.Color = require('./tree/color')(less.data, tree);
|
||||
tree.Directive = require('./tree/directive')(tree);
|
||||
tree.DetachedRuleset = require('./tree/detached-ruleset')(tree);
|
||||
tree.Operation = require('./tree/operation')(tree);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = function (tree) {
|
||||
module.exports = function (data, tree) {
|
||||
//
|
||||
// RGB Colors - #ff0014, #eee
|
||||
//
|
||||
@@ -165,8 +165,8 @@ Color.prototype = {
|
||||
|
||||
Color.fromKeyword = function(keyword) {
|
||||
var c, key = keyword.toLowerCase();
|
||||
if (tree.colors.hasOwnProperty(key)) {
|
||||
c = new(Color)(tree.colors[key].slice(1));
|
||||
if (data.colors.hasOwnProperty(key)) {
|
||||
c = new(Color)(data.colors[key].slice(1));
|
||||
}
|
||||
else if (key === "transparent") {
|
||||
c = new(Color)([0, 0, 0], 0);
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = function (tree) {
|
||||
return ticker;
|
||||
}
|
||||
|
||||
tree.visitor = function(implementation) {
|
||||
var visitor = function(implementation) {
|
||||
this._implementation = implementation;
|
||||
this._visitFnCache = [];
|
||||
|
||||
@@ -40,7 +40,7 @@ module.exports = function (tree) {
|
||||
}
|
||||
};
|
||||
|
||||
tree.visitor.prototype = {
|
||||
visitor.prototype = {
|
||||
visit: function(node) {
|
||||
if (!node) {
|
||||
return node;
|
||||
@@ -142,5 +142,5 @@ module.exports = function (tree) {
|
||||
return out;
|
||||
}
|
||||
};
|
||||
|
||||
return visitor;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user