UNPKG

668 BJavaScriptView Raw
1var util = require('util');
2var helpers = require('../helpers');
3
4var VariableDeclaration = module.exports = function(declarations, kind) {
5 this.type = 'VariableDeclaration';
6 this.declarations = declarations;
7 this.kind = kind;
8 this.async = false;
9 if (!util.isArray(this.declarations)) {
10 this.declarations = [this.declarations];
11 }
12 if (!this.kind) {
13 this.kind = 'var';
14 }
15};
16
17VariableDeclaration.prototype.normalize = function(place) {
18 this.declarations.forEach(function (declaration) {
19 declaration.normalize();
20 });
21 place.push(this);
22};
23
24VariableDeclaration.prototype.transform = function(place) {
25 place.push(this);
26 return place;
27};