Skip to content

Commit

Permalink
fix bug in deprecated builders
Browse files Browse the repository at this point in the history
  • Loading branch information
zxbodya committed May 18, 2020
1 parent c7e20ad commit 37251aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -42,7 +42,7 @@ import builder from "../builder";\n\n`;
const newType = definitions.DEPRECATED_KEYS[type];
output += `export function ${type}(...args: Array<any>): Object {
console.trace("The node type ${type} has been renamed to ${newType}");
return ${type}("${type}", ...args);
return builder("${type}", ...args);
}
export { ${type} as ${formatBuilderName(type)} };\n`;

Expand Down
8 changes: 4 additions & 4 deletions packages/babel-types/src/builders/generated/index.js
Expand Up @@ -1035,23 +1035,23 @@ export function NumberLiteral(...args: Array<any>): Object {
console.trace(
"The node type NumberLiteral has been renamed to NumericLiteral",
);
return NumberLiteral("NumberLiteral", ...args);
return builder("NumberLiteral", ...args);
}
export { NumberLiteral as numberLiteral };
export function RegexLiteral(...args: Array<any>): Object {
console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
return RegexLiteral("RegexLiteral", ...args);
return builder("RegexLiteral", ...args);
}
export { RegexLiteral as regexLiteral };
export function RestProperty(...args: Array<any>): Object {
console.trace("The node type RestProperty has been renamed to RestElement");
return RestProperty("RestProperty", ...args);
return builder("RestProperty", ...args);
}
export { RestProperty as restProperty };
export function SpreadProperty(...args: Array<any>): Object {
console.trace(
"The node type SpreadProperty has been renamed to SpreadElement",
);
return SpreadProperty("SpreadProperty", ...args);
return builder("SpreadProperty", ...args);
}
export { SpreadProperty as spreadProperty };

0 comments on commit 37251aa

Please sign in to comment.