We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3eb158 commit ecf1f8cCopy full SHA for ecf1f8c
1 file changed
src/variable.js
@@ -9,10 +9,10 @@ var node = require('./node');
9
10
/**
11
* **Extends from {@link NODE.md|:link: node}**
12
- *
+ *
13
* Reprensents a variable declaration
14
15
- * @public
+ * @public
16
* @constructor variable
17
* @property {String} name
18
*/
@@ -22,9 +22,11 @@ var variable = node.extends('variable');
22
* @protected Consumes the current ast node
23
24
variable.prototype.consume = function(ast) {
25
- this.name = ast[1][1];
+ if (ast.kind === 'assign') {
26
+ this.name = ast.left.name;
27
+ } else {
28
+ this.name = ast.name;
29
+ }
30
};
31
32
module.exports = variable;
-
0 commit comments