Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

api: fix api, use estraverse module

  • Loading branch information...
commit 6b85f7b99b93ac869cf24f5c7ce98724703cd788 1 parent 43f0427
@indutny authored
Showing with 5 additions and 3 deletions.
  1. +3 −2 lib/spoon/api.js
  2. +2 −1  package.json
View
5 lib/spoon/api.js
@@ -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
3  package.json
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.