From 5a1984aa413b4776de92300c163372fbf873ad51 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Thu, 29 Sep 2016 14:14:39 +0200 Subject: [PATCH] make babel-helper-remap-async-to-generator bc with babel 6.15 and lower (#4603) --- packages/babel-helper-remap-async-to-generator/src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/babel-helper-remap-async-to-generator/src/index.js b/packages/babel-helper-remap-async-to-generator/src/index.js index 00bccfa42b..64c2a47439 100644 --- a/packages/babel-helper-remap-async-to-generator/src/index.js +++ b/packages/babel-helper-remap-async-to-generator/src/index.js @@ -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