Sha256: 585c752fbbf2c6ff830f529e6c99f0a0713ca37e11b6821d572afe4bd9a447c2
Contents?: true
Size: 1.03 KB
Versions: 29
Compression:
Stored size: 1.03 KB
Contents
/*! * Stylus - Call * Copyright(c) 2010 LearnBoost <dev@learnboost.com> * MIT Licensed */ /** * Module dependencies. */ var Node = require('./node'); /** * Initialize a new `Call` with `name` and `args`. * * @param {String} name * @param {Expression} args * @api public */ var Call = module.exports = function Call(name, args){ Node.call(this); this.name = name; this.args = args; }; /** * Inherit from `Node.prototype`. */ Call.prototype.__proto__ = Node.prototype; /** * Return a clone of this node. * * @return {Node} * @api public */ Call.prototype.clone = function(){ var clone = new Call(this.name, this.args.clone()); clone.lineno = this.lineno; clone.filename = this.filename; return clone; }; /** * Return <name>(param1, param2, ...). * * @return {String} * @api public */ Call.prototype.toString = function(){ var args = this.args.nodes.map(function(node) { var str = node.toString(); return str.slice(1, str.length - 1); }).join(', '); return this.name + '(' + args + ')'; };
Version data entries
29 entries across 29 versions & 2 rubygems