diff --git a/package.json b/package.json index d67dbb7..ffc861a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "homepage": "https://github.com/thlorenz/rename-function-calls", "dependencies": { - "detective": "~3.1.0" + "detective": "4.x.x" }, "devDependencies": { "tap": "~0.4.3" diff --git a/test/fixtures/async-function.js b/test/fixtures/async-function.js new file mode 100644 index 0000000..6e638f7 --- /dev/null +++ b/test/fixtures/async-function.js @@ -0,0 +1,23 @@ +// { "from": "xxx", "to": "x" } +'use strict'; + +function x() { } +function y() { } +function z() { } + +var go = module.exports = async function () { + xxx(); + y(); + z(); + + function nested() { + return xxx(); + function oneMoreLevel () { + xxx(); z(); xxx(); + } + } + + function nestedExpression() { + return 1 + xxx(); + } +}; diff --git a/test/fixtures/async-function.renamed.js b/test/fixtures/async-function.renamed.js new file mode 100644 index 0000000..af65274 --- /dev/null +++ b/test/fixtures/async-function.renamed.js @@ -0,0 +1,22 @@ +'use strict'; + +function x() { } +function y() { } +function z() { } + +var go = module.exports = async function () { + x(); + y(); + z(); + + function nested() { + return x(); + function oneMoreLevel () { + x(); z(); x(); + } + } + + function nestedExpression() { + return 1 + x(); + } +};