@@ -61,6 +61,7 @@ export class SchemaService {
6161 constructor ( public ctx : Context ) { }
6262
6363 extend ( name : string , schema : Schema , order = 0 ) {
64+ const caller = this [ Context . current ]
6465 const target = this . get ( name )
6566 const index = target . list . findIndex ( a => a [ kSchemaOrder ] < order )
6667 schema [ kSchemaOrder ] = order
@@ -70,7 +71,7 @@ export class SchemaService {
7071 target . list . push ( schema )
7172 }
7273 this . ctx . emit ( 'internal/schema' , name )
73- this [ Context . current ] ?. on ( 'dispose' , ( ) => {
74+ caller ?. on ( 'dispose' , ( ) => {
7475 remove ( target . list , schema )
7576 this . ctx . emit ( 'internal/schema' , name )
7677 } )
@@ -81,9 +82,10 @@ export class SchemaService {
8182 }
8283
8384 set ( name : string , schema : Schema ) {
85+ const caller = this [ Context . current ]
8486 this . _data [ name ] = schema
8587 this . ctx . emit ( 'internal/schema' , name )
86- this [ Context . current ] ?. on ( 'dispose' , ( ) => {
88+ caller ?. on ( 'dispose' , ( ) => {
8789 delete this . _data [ name ]
8890 this . ctx . emit ( 'internal/schema' , name )
8991 } )
0 commit comments