( code, opts?, callback?: FileParseCallback, )
| 34 | }); |
| 35 | |
| 36 | export const parse: Parse = function parse( |
| 37 | code, |
| 38 | opts?, |
| 39 | callback?: FileParseCallback, |
| 40 | ) { |
| 41 | if (typeof opts === "function") { |
| 42 | callback = opts; |
| 43 | opts = undefined; |
| 44 | } |
| 45 | |
| 46 | if (callback === undefined) { |
| 47 | throw new Error( |
| 48 | "Starting from Babel 8.0.0, the 'parse' function expects a callback. If you need to call it synchronously, please use 'parseSync'.", |
| 49 | ); |
| 50 | } |
| 51 | |
| 52 | beginHiddenCallStack(parseRunner.errback)(code, opts, callback); |
| 53 | return null; |
| 54 | }; |
| 55 | |
| 56 | export function parseSync(...args: Parameters<typeof parseRunner.sync>) { |
| 57 | return beginHiddenCallStack(parseRunner.sync)(...args); |
nothing calls this directly
no test coverage detected