complete redesign: use nodejs on server instead of php - documentation to be updated
This commit is contained in:
90
nodejs/node_modules/stylus/lib/nodes/params.js
generated
vendored
Normal file
90
nodejs/node_modules/stylus/lib/nodes/params.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
|
||||
/*!
|
||||
* Stylus - Params
|
||||
* Copyright (c) Automattic <developer.wordpress.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(parent){
|
||||
var clone = new Params;
|
||||
clone.lineno = this.lineno;
|
||||
clone.column = this.column;
|
||||
clone.filename = this.filename;
|
||||
this.nodes.forEach(function(node){
|
||||
clone.push(node.clone(parent, clone));
|
||||
});
|
||||
return clone;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a JSON representation of this node.
|
||||
*
|
||||
* @return {Object}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Params.prototype.toJSON = function(){
|
||||
return {
|
||||
__type: 'Params',
|
||||
nodes: this.nodes,
|
||||
lineno: this.lineno,
|
||||
column: this.column,
|
||||
filename: this.filename
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user