Sha256: 0c4f090eb4763f8f3b78fdd7f3e7349d85fef8a01aa5251dde9eed1aefe02863

Contents?: true

Size: 1.04 KB

Versions: 41

Compression:

Stored size: 1.04 KB

Contents

/*!
 * Stylus - Return
 * Copyright (c) Automattic <developer.wordpress.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.column = this.column;
  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,
    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/return.js
epuber-stylus-source-0.54.8 vendor/lib/nodes/return.js
ela-4.1.6 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-4.1.6 node_modules/stylus/lib/nodes/return.js
ela-4.1.5 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-4.1.5 node_modules/stylus/lib/nodes/return.js
ela-4.1.4 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-4.1.4 node_modules/stylus/lib/nodes/return.js
ela-4.1.3 node_modules/stylus/lib/nodes/return.js
ela-4.1.3 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-4.1.2 node_modules/stylus/lib/nodes/return.js
ela-4.1.2 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-4.1.1 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-4.1.1 node_modules/stylus/lib/nodes/return.js
ela-4.1.0 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-4.1.0 node_modules/stylus/lib/nodes/return.js
ela-4.0.0 node_modules/stylus/lib/nodes/return.js
ela-4.0.0 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-3.4.3 node_modules/nib/node_modules/stylus/lib/nodes/return.js
ela-3.4.3 node_modules/stylus/lib/nodes/return.js