Sha256: b718696f60ef71b964be7e320676c0149472849ba53d986206fa4db49446db48

Contents?: true

Size: 1006 Bytes

Versions: 33

Compression:

Stored size: 1006 Bytes

Contents

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

/**
 * Module dependencies.
 */

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

/**
 * Initialize a new `Return` node with the given `expr`.
 *
 * @param {Expression} expr
 * @api public
 */

var Return = module.exports = function Return(expr){
  this.expr = expr || nodes.null;
};

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

Return.prototype.__proto__ = Node.prototype;

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

Return.prototype.clone = function(parent){
  var clone = new Return();
  clone.expr = this.expr.clone(parent, clone);
  clone.lineno = this.lineno;
  clone.filename = this.filename;
  return clone;
};

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

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

Version data entries

33 entries across 19 versions & 1 rubygems

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