27 lines
503 B
JavaScript
27 lines
503 B
JavaScript
|
'use strict';
|
||
|
|
||
|
var Node = require('./node');
|
||
|
|
||
|
/**
|
||
|
* Initialize an `Each` node, representing iteration
|
||
|
*
|
||
|
* @param {String} obj
|
||
|
* @param {String} val
|
||
|
* @param {String} key
|
||
|
* @param {Block} block
|
||
|
* @api public
|
||
|
*/
|
||
|
|
||
|
var Each = module.exports = function Each(obj, val, key, block) {
|
||
|
this.obj = obj;
|
||
|
this.val = val;
|
||
|
this.key = key;
|
||
|
this.block = block;
|
||
|
};
|
||
|
|
||
|
// Inherit from `Node`.
|
||
|
Each.prototype = Object.create(Node.prototype);
|
||
|
Each.prototype.constructor = Each;
|
||
|
|
||
|
Each.prototype.type = 'Each';
|