Permalink
Browse files

api: fix api, use estraverse module

  • Loading branch information...
1 parent 43f0427 commit 6b85f7b99b93ac869cf24f5c7ce98724703cd788 @indutny committed Feb 12, 2013
Showing with 5 additions and 3 deletions.
  1. +3 −2 lib/spoon/api.js
  2. +2 −1 package.json
View
@@ -1,6 +1,7 @@
var api = exports,
esprima = require('esprima'),
- escodegen = require('escodegen');
+ escodegen = require('escodegen'),
+ estraverse = require('estraverse');
api.construct = function construct(ast) {
var cfg = api.spoon.cfg.create();
@@ -21,7 +22,7 @@ function patch(ast, decl, callback) {
body = null,
stack = [];
- escodegen.traverse(ast, {
+ estraverse.traverse(ast, {
enter: function(ast) {
if (ast.type === 'Literal') {
if (ast.value === decl && fn) {
View
@@ -4,7 +4,8 @@
"main": "lib/spoon",
"dependencies": {
"esprima": "~1.0.2",
- "escodegen": "~0.0.15"
+ "escodegen": "~0.0.15",
+ "estraverse": "~0.0.4"
},
"devDependencies": {
"mocha": "~1.4.2"

0 comments on commit 6b85f7b

Please sign in to comment.