Sha256: 2af0a201f20271e2f22df70ea7f08318124115b7c588cdd6ae68a5bc50c618c7

Contents?: true

Size: 1.17 KB

Versions: 41

Compression:

Stored size: 1.17 KB

Contents

/*!
 * Stylus - Null
 * Copyright (c) Automattic <developer.wordpress.com>
 * MIT Licensed
 */

/**
 * Module dependencies.
 */

var Node = require('./node')
  , nodes = require('./');

/**
 * Initialize a new `Null` node.
 *
 * @api public
 */

var Null = module.exports = function Null(){};

/**
 * Inherit from `Node.prototype`.
 */

Null.prototype.__proto__ = Node.prototype;

/**
 * Return 'Null'.
 *
 * @return {String}
 * @api public
 */

Null.prototype.inspect = 
Null.prototype.toString = function(){
  return 'null';
};

/**
 * Return false.
 *
 * @return {Boolean}
 * @api public
 */

Null.prototype.toBoolean = function(){
  return nodes.false;
};

/**
 * Check if the node is a null node.
 *
 * @return {Boolean}
 * @api public
 */

Null.prototype.__defineGetter__('isNull', function(){
  return true;
});

/**
 * Return hash.
 *
 * @return {String}
 * @api public
 */

Null.prototype.__defineGetter__('hash', function(){
  return null;
});

/**
 * Return a JSON representation of this node.
 *
 * @return {Object}
 * @api public
 */

Null.prototype.toJSON = function(){
  return {
    __type: 'Null',
    lineno: this.lineno,
    column: this.column,
    filename: this.filename
  };
};

Version data entries

41 entries across 22 versions & 3 rubygems

Version Path
epuber-stylus-source-0.56.0 vendor/lib/nodes/null.js
epuber-stylus-source-0.54.8 vendor/lib/nodes/null.js
ela-4.1.6 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-4.1.6 node_modules/stylus/lib/nodes/null.js
ela-4.1.5 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-4.1.5 node_modules/stylus/lib/nodes/null.js
ela-4.1.4 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-4.1.4 node_modules/stylus/lib/nodes/null.js
ela-4.1.3 node_modules/stylus/lib/nodes/null.js
ela-4.1.3 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-4.1.2 node_modules/stylus/lib/nodes/null.js
ela-4.1.2 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-4.1.1 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-4.1.1 node_modules/stylus/lib/nodes/null.js
ela-4.1.0 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-4.1.0 node_modules/stylus/lib/nodes/null.js
ela-4.0.0 node_modules/stylus/lib/nodes/null.js
ela-4.0.0 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-3.4.3 node_modules/nib/node_modules/stylus/lib/nodes/null.js
ela-3.4.3 node_modules/stylus/lib/nodes/null.js