ast-parents
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -8,4 +8,4 @@ module.exports = addParents | ||
function walk(node, key, parent) { | ||
if (parent) Object.defineProperty(node, key, { | ||
function walk(node, keyname, parent) { | ||
if (parent) Object.defineProperty(node, keyname, { | ||
value: parent | ||
@@ -27,9 +27,9 @@ , configurable: true | ||
if (child[i] && child[i].type) | ||
walk(child[i], key, child) | ||
walk(child[i], keyname, node) | ||
} | ||
} else | ||
if (child && child.type) { | ||
walk(child, key, node) | ||
walk(child, keyname, node) | ||
} | ||
} | ||
} |
{ | ||
"name": "ast-parents", | ||
"description": "Walks a JavaScript AST and adds a \"parent\" property to each node", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "browser": "index.js", |
3697