Commit 7c19b8d7 authored by Aniket's avatar Aniket

Update astWalker.js

parent cb697fb2
...@@ -21,7 +21,7 @@ AstWalker.prototype.walk = function (ast, callback) { ...@@ -21,7 +21,7 @@ AstWalker.prototype.walk = function (ast, callback) {
if (!('*' in callback)) { if (!('*' in callback)) {
callback['*'] = function () { return true } callback['*'] = function () { return true }
} }
if(ast){ if(ast) {
const nodes = ast.nodes || (ast.body && ast.body.statements) || ast.declarations || [] const nodes = ast.nodes || (ast.body && ast.body.statements) || ast.declarations || []
if(ast.body && ast.initializationExpression) // 'for' loop handling if(ast.body && ast.initializationExpression) // 'for' loop handling
nodes.push(ast.initializationExpression) nodes.push(ast.initializationExpression)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment