Sha256: 1cf3a83b94f429fb0bf65492359ad2a5fedda46a35e177d24bb7929a5fe7f995

Contents?: true

Size: 1.09 KB

Versions: 100

Compression:

Stored size: 1.09 KB

Contents

/*!
 * Stylus - Params
 * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
 * MIT Licensed
 */

/**
 * Module dependencies.
 */

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

/**
 * Initialize a new `Params` with `name`, `params`, and `body`.
 *
 * @param {String} name
 * @param {Params} params
 * @param {Expression} body
 * @api public
 */

var Params = module.exports = function Params(){
  Node.call(this);
  this.nodes = [];
};

/**
 * Check function arity.
 *
 * @return {Boolean}
 * @api public
 */

Params.prototype.__defineGetter__('length', function(){
  return this.nodes.length;
});

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

Params.prototype.__proto__ = Node.prototype;

/**
 * Push the given `node`.
 *
 * @param {Node} node
 * @api public
 */

Params.prototype.push = function(node){
  this.nodes.push(node);
};

/**
 * Return a clone of this node.
 * 
 * @return {Node}
 * @api public
 */

Params.prototype.clone = function(){
  var clone = new Params;
  clone.lineno = this.lineno;
  clone.filename = this.filename;
  this.nodes.forEach(function(node){
    clone.push(node.clone());
  });
  return clone;
};

Version data entries

100 entries across 86 versions & 2 rubygems

Version Path
ela-4.1.6 node_modules/poised/node_modules/nib/node_modules/stylus/lib/nodes/params.js
ela-4.1.6 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-4.1.5 node_modules/poised/node_modules/nib/node_modules/stylus/lib/nodes/params.js
ela-4.1.5 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-4.1.4 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-4.1.4 node_modules/poised/node_modules/nib/node_modules/stylus/lib/nodes/params.js
ela-4.1.3 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-4.1.3 node_modules/poised/node_modules/nib/node_modules/stylus/lib/nodes/params.js
ela-4.1.2 node_modules/poised/node_modules/nib/node_modules/stylus/lib/nodes/params.js
ela-4.1.2 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-4.1.1 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-4.1.1 node_modules/poised/node_modules/nib/node_modules/stylus/lib/nodes/params.js
ela-4.1.0 node_modules/poised/node_modules/nib/node_modules/stylus/lib/nodes/params.js
ela-4.1.0 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-4.0.0 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-3.4.3 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-3.4.2 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-3.4.0 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-3.3.1 node_modules/codo/node_modules/stylus/lib/nodes/params.js
ela-3.3.0 node_modules/codo/node_modules/stylus/lib/nodes/params.js