UNPKG

654 BJavaScriptView Raw
1
2/*!
3 * Jade - nodes - Code
4 * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
5 * MIT Licensed
6 */
7
8/**
9 * Module dependencies.
10 */
11
12var Node = require('./node');
13
14/**
15 * Initialize a `Code` node with the given code `val`.
16 * Code may also be optionally buffered and escaped.
17 *
18 * @param {String} val
19 * @param {Boolean} buffer
20 * @param {Boolean} escape
21 * @api public
22 */
23
24var Code = module.exports = function Code(val, buffer, escape) {
25 this.val = val;
26 this.buffer = buffer;
27 this.escape = escape;
28 if (/^ *else/.test(val)) this.instrumentLineNumber = false;
29};
30
31/**
32 * Inherit from `Node`.
33 */
34
35Code.prototype.__proto__ = Node.prototype;
\No newline at end of file