~george-edison55/less/trunk

« back to all changes in this revision

Viewing changes to lib/less/tree/keyword.js

  • Committer: Nathan Osman
  • Date: 2013-04-16 22:43:51 UTC
  • Revision ID: admin@quickmediasolutions.com-20130416224351-5juqujuu4itkwpat
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(function (tree) {
 
2
 
 
3
tree.Keyword = function (value) { this.value = value };
 
4
tree.Keyword.prototype = {
 
5
    type: "Keyword",
 
6
    eval: function () { return this; },
 
7
    toCSS: function () { return this.value; },
 
8
    compare: function (other) {
 
9
        if (other instanceof tree.Keyword) {
 
10
            return other.value === this.value ? 0 : 1;
 
11
        } else {
 
12
            return -1;
 
13
        }
 
14
    }
 
15
};
 
16
 
 
17
tree.True = new(tree.Keyword)('true');
 
18
tree.False = new(tree.Keyword)('false');
 
19
 
 
20
})(require('../tree'));