make babel-helper-remap-async-to-generator bc with babel 6.15 and lower (#4603)

This commit is contained in:
Daniel Tschinder
2016-09-29 14:14:39 +02:00
committed by Henry Zhu
parent 682e9658c9
commit 5a1984aa41

View File

@@ -152,6 +152,11 @@ function plainFunction(path: NodePath, callId: Object) {
}
export default function (path: NodePath, file: Object, helpers: Object) {
if (!helpers) {
// bc for 6.15 and earlier
helpers = { wrapAsync: file };
file = null;
}
path.traverse(awaitVisitor, {
file,
wrapAwait: helpers.wrapAwait