Skip to content

Commit 2ef0948

Browse files
Use t.buildUndefinedNode instead of Scope#buildUndefinedNode
Babel 8 is _likely_ going to remove the variant on `Scope#`, since this method has not needed scope-specific information in ages.
1 parent afb4ef2 commit 2ef0948

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/angular/build/src/tools/babel/plugins/elide-angular-metadata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const angularMetadataFunctions: Record<string, (args: NodePath[]) => boolean> =
4848
*
4949
* @returns A babel plugin object instance.
5050
*/
51-
export default function (): PluginObj {
51+
export default function ({ types: t }): PluginObj {
5252
return {
5353
visitor: {
5454
CallExpression(path) {
@@ -79,7 +79,7 @@ export default function (): PluginObj {
7979
if (parent && (parent.isFunctionExpression() || parent.isArrowFunctionExpression())) {
8080
// Replace the metadata function with `void 0` which is the equivalent return value
8181
// of the metadata function.
82-
path.replaceWith(path.scope.buildUndefinedNode());
82+
path.replaceWith(t.buildUndefinedNode());
8383
}
8484
}
8585
},

0 commit comments

Comments
 (0)