File tree Expand file tree Collapse file tree
packages/babel-helper-create-class-features-plugin/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ function extractElementDescriptor(
8282 prop ( "decorators" , takeDecorators ( node as Decorable ) ) ,
8383 prop (
8484 "static" ,
85- ! t . isStaticBlock ( node ) && node . static && t . booleanLiteral ( true ) ,
85+ // @ts -expect-error: TS doesn't infer that node is not a StaticBlock
86+ ! t . isStaticBlock ?.( node ) && node . static && t . booleanLiteral ( true ) ,
8687 ) ,
8788 prop ( "key" , getKey ( node ) ) ,
8889 ] . filter ( Boolean ) ;
Original file line number Diff line number Diff line change @@ -911,7 +911,8 @@ function replaceThisContext(
911911 getSuperRef,
912912 getObjectRef ( ) {
913913 state . needsClassRef = true ;
914- return t . isStaticBlock ( path . node ) || path . node . static
914+ // @ts -expect-error: TS doesn't infer that path.node is not a StaticBlock
915+ return t . isStaticBlock ?.( path . node ) || path . node . static
915916 ? ref
916917 : t . memberExpression ( ref , t . identifier ( "prototype" ) ) ;
917918 } ,
@@ -964,7 +965,8 @@ export function buildFieldsInitNodes(
964965 for ( const prop of props ) {
965966 prop . isClassProperty ( ) && ts . assertFieldTransformed ( prop ) ;
966967
967- const isStatic = ! t . isStaticBlock ( prop . node ) && prop . node . static ;
968+ // @ts -expect-error: TS doesn't infer that prop.node is not a StaticBlock
969+ const isStatic = ! t . isStaticBlock ?.( prop . node ) && prop . node . static ;
968970 const isInstance = ! isStatic ;
969971 const isPrivate = prop . isPrivate ( ) ;
970972 const isPublic = ! isPrivate ;
Original file line number Diff line number Diff line change @@ -242,7 +242,8 @@ export function createClassFeaturePlugin({
242242 ( referenceVisitor , state ) => {
243243 if ( isDecorated ) return ;
244244 for ( const prop of props ) {
245- if ( t . isStaticBlock ( prop . node ) || prop . node . static ) continue ;
245+ // @ts -expect-error: TS doesn't infer that prop.node is not a StaticBlock
246+ if ( t . isStaticBlock ?.( prop . node ) || prop . node . static ) continue ;
246247 prop . traverse ( referenceVisitor , state ) ;
247248 }
248249 } ,
You can’t perform that action at this time.
0 commit comments