The following examples each currently result in errors:
function doesSomethingWithAPromise() {
promise.then(doSomething);
}
function returnsSomethingDone() {
return promise.then(doSomething);
}
Error:
TypeError: Cannot read property 'type' of undefined
at transformFunction (async-await.js:123:23)
at NodePath.paths.forEach.path (async-await.js:166:13)
at __paths.forEach (node_modules/jscodeshift/dist/Collection.js:76:36)
at Array.forEach (<anonymous>)
at Collection.forEach (node_modules/jscodeshift/dist/Collection.js:75:18)
at replaceType (async-await.js:165:13)
at transformer (async-await.js:173:3)
at runInlineTest (node_modules/jscodeshift/dist/testUtils.js:28:18)
at runTest (node_modules/jscodeshift/dist/testUtils.js:73:3)
at Object.it (node_modules/jscodeshift/dist/testUtils.js:90:7)
The following examples each currently result in errors:
Error:
Instead, they should be transformed as follows: