Skip to content
Browse files

api: fix API once again

  • Loading branch information...
1 parent a44fe3e commit 34bda0c91fd6e99cba5d63c98baea53427cf107d @indutny committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/spoon/api.js
View
4 lib/spoon/api.js
@@ -27,7 +27,7 @@ function patch(ast, decl, callback) {
if (ast.value === decl && fn) {
body = {
type: 'BlockStatement',
- body: callback(fn.body)
+ body: callback(fn).body
};
}
return;
@@ -68,7 +68,7 @@ api.preprocess = function preprocess(code, options, callback) {
if (callback) callback(cfg);
- ast = api.spoon.render(cfg).body;
+ ast = api.spoon.render(cfg).body[0];
// Get function out of expression
if (ast.type === 'ExpressionStatement') {

0 comments on commit 34bda0c

Please sign in to comment.
Something went wrong with that request. Please try again.