Fix order of optional argument reordering (#8376)
Previously, if the optional `opts` parameter wasn't passed, the _intent_ was to move the function it held into the `callback` parameter and null out the `opts` param - but instead, it was nulling both.
This commit is contained in:
parent
75767e9273
commit
db2a9fc96e
@ -24,8 +24,8 @@ type Parse = {
|
||||
|
||||
export const parse: Parse = (function parse(code, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
opts = undefined;
|
||||
callback = opts;
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
// For backward-compat with Babel 7's early betas, we allow sync parsing when
|
||||
|
||||
@ -31,8 +31,8 @@ export const transformFromAst: TransformFromAst = (function transformFromAst(
|
||||
callback,
|
||||
) {
|
||||
if (typeof opts === "function") {
|
||||
opts = undefined;
|
||||
callback = opts;
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
// For backward-compat with Babel 6, we allow sync transformation when
|
||||
|
||||
@ -18,8 +18,8 @@ type Transform = {
|
||||
|
||||
export const transform: Transform = (function transform(code, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
opts = undefined;
|
||||
callback = opts;
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
// For backward-compat with Babel 6, we allow sync transformation when
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user