source: trip-planner-front/node_modules/stylus/lib/nodes/return.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1
2/*!
3 * Stylus - Return
4 * Copyright (c) Automattic <developer.wordpress.com>
5 * MIT Licensed
6 */
7
8/**
9 * Module dependencies.
10 */
11
12var Node = require('./node')
13 , nodes = require('./');
14
15/**
16 * Initialize a new `Return` node with the given `expr`.
17 *
18 * @param {Expression} expr
19 * @api public
20 */
21
22var Return = module.exports = function Return(expr){
23 this.expr = expr || nodes.null;
24};
25
26/**
27 * Inherit from `Node.prototype`.
28 */
29
30Return.prototype.__proto__ = Node.prototype;
31
32/**
33 * Return a clone of this node.
34 *
35 * @return {Node}
36 * @api public
37 */
38
39Return.prototype.clone = function(parent){
40 var clone = new Return();
41 clone.expr = this.expr.clone(parent, clone);
42 clone.lineno = this.lineno;
43 clone.column = this.column;
44 clone.filename = this.filename;
45 return clone;
46};
47
48/**
49 * Return a JSON representation of this node.
50 *
51 * @return {Object}
52 * @api public
53 */
54
55Return.prototype.toJSON = function(){
56 return {
57 __type: 'Return',
58 expr: this.expr,
59 lineno: this.lineno,
60 column: this.column,
61 filename: this.filename
62 };
63};
Note: See TracBrowser for help on using the repository browser.