summaryrefslogtreecommitdiff
path: root/node_modules/@babel/core/cjs-proxy.cjs
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/core/cjs-proxy.cjs')
-rw-r--r--node_modules/@babel/core/cjs-proxy.cjs9
1 files changed, 9 insertions, 0 deletions
diff --git a/node_modules/@babel/core/cjs-proxy.cjs b/node_modules/@babel/core/cjs-proxy.cjs
index 17dac4a9..accdb43d 100644
--- a/node_modules/@babel/core/cjs-proxy.cjs
+++ b/node_modules/@babel/core/cjs-proxy.cjs
@@ -29,6 +29,15 @@ const propertyNames = [
for (const name of functionNames) {
exports[name] = function (...args) {
+ if (
+ process.env.BABEL_8_BREAKING &&
+ typeof args[args.length - 1] !== "function"
+ ) {
+ throw new Error(
+ `Starting from Babel 8.0.0, the '${name}' function expects a callback. If you need to call it synchronously, please use '${name}Sync'.`
+ );
+ }
+
babelP.then(babel => {
babel[name](...args);
});