@@ -76,16 +76,16 @@ export class ClassScanner implements JavaScriptScanner {
7676 document : JavaScriptDocument ,
7777 visit : ( visitor : Visitor ) => Promise < void > ) {
7878 const classFinder = new ClassFinder ( document ) ;
79- const mixinFinder = new MixinVisitor ( document ) ;
8079 const elementDefinitionFinder =
8180 new CustomElementsDefineCallFinder ( document ) ;
8281 const prototypeMemberFinder = new PrototypeMemberFinder ( document ) ;
82+ await visit ( prototypeMemberFinder ) ;
83+ const mixinFinder = new MixinVisitor ( document , prototypeMemberFinder ) ;
8384 // Find all classes and all calls to customElements.define()
8485 await Promise . all ( [
8586 visit ( classFinder ) ,
8687 visit ( elementDefinitionFinder ) ,
8788 visit ( mixinFinder ) ,
88- visit ( prototypeMemberFinder ) ,
8989 ] ) ;
9090 const mixins = mixinFinder . mixins ;
9191
@@ -424,7 +424,7 @@ interface CustomElementDefinition {
424424 definition ?: ElementDefineCall ;
425425}
426426
427- class PrototypeMemberFinder implements Visitor {
427+ export class PrototypeMemberFinder implements Visitor {
428428 readonly members = new MapWithDefault < string , {
429429 methods : Map < string , ScannedMethod > ,
430430 properties : Map < string , ScannedProperty >
@@ -505,16 +505,16 @@ class PrototypeMemberFinder implements Visitor {
505505 }
506506
507507 if ( jsdoc . hasTag ( jsdocAnn , 'function' ) ) {
508- const prop =
508+ const method =
509509 this . _createMethodFromExpression ( node . property . name , node , jsdocAnn ) ;
510- if ( prop ) {
511- this . _addMethodToClass ( cls , prop ) ;
510+ if ( method ) {
511+ this . _addMethodToClass ( cls , method ) ;
512512 }
513513 } else {
514- const method = this . _createPropertyFromExpression (
514+ const prop = this . _createPropertyFromExpression (
515515 node . property . name , node , jsdocAnn ) ;
516- if ( method ) {
517- this . _addPropertyToClass ( cls , method ) ;
516+ if ( prop ) {
517+ this . _addPropertyToClass ( cls , prop ) ;
518518 }
519519 }
520520 }
0 commit comments