@@ -131,8 +131,6 @@ class ExpressionVisitor {
131131 private helper : VisitorHelper ,
132132 private expressionNode : ts . Expression ,
133133 private stubbedFunctionName ?: string ,
134- private className ?: ts . Identifier ,
135- private methodNode ?: ts . MethodDeclaration ,
136134 ) { }
137135
138136 public result ( ) : ts . Expression {
@@ -168,16 +166,12 @@ class ExpressionVisitor {
168166 const targetType = ptypes . ptypeToArc4EncodedType ( type , this . helper . sourceLocation ( node ) )
169167 const targetTypeInfo = getGenericTypeInfo ( targetType )
170168 infoArg = targetTypeInfo
171- } else if ( isCallingDecoratorMethod ( stubbedFunctionName ) ) {
172- this . helper . additionalStatements . push ( nodeFactory . captureMethodConfig ( this . className ! , this . methodNode ! , updatedNode ) )
173169 }
174170
175171 updatedNode = stubbedFunctionName
176172 ? isCallingMethodSelector ( stubbedFunctionName )
177173 ? nodeFactory . callMethodSelectorFunction ( updatedNode )
178- : isCallingDecoratorMethod ( stubbedFunctionName )
179- ? updatedNode
180- : nodeFactory . callStubbedFunction ( stubbedFunctionName , updatedNode , infoArg )
174+ : nodeFactory . callStubbedFunction ( stubbedFunctionName , updatedNode , infoArg )
181175 : updatedNode
182176 }
183177 return needsToCaptureTypeInfo
@@ -214,8 +208,6 @@ class FunctionOrMethodVisitor {
214208 constructor (
215209 protected context : ts . TransformationContext ,
216210 protected helper : VisitorHelper ,
217- protected className ?: ts . Identifier ,
218- protected methodNode ?: ts . MethodDeclaration ,
219211 ) { }
220212 protected visit = ( node : ts . Node ) : ts . Node => {
221213 return ts . visitEachChild ( this . updateNode ( node ) , this . visit , this . context )
@@ -276,7 +268,7 @@ class FunctionOrMethodVisitor {
276268 if ( ts . isCallExpression ( node ) ) {
277269 const stubbedFunctionName = tryGetStubbedFunctionName ( node , this . helper )
278270 if ( stubbedFunctionName ) {
279- return new ExpressionVisitor ( this . context , this . helper , node , stubbedFunctionName , this . className , this . methodNode ) . result ( )
271+ return new ExpressionVisitor ( this . context , this . helper , node , stubbedFunctionName ) . result ( )
280272 }
281273 }
282274
@@ -301,10 +293,9 @@ class MethodDecVisitor extends FunctionOrMethodVisitor {
301293 constructor (
302294 context : ts . TransformationContext ,
303295 helper : VisitorHelper ,
304- methodNode : ts . MethodDeclaration ,
305- className : ts . Identifier | undefined ,
296+ private methodNode : ts . MethodDeclaration ,
306297 ) {
307- super ( context , helper , className , methodNode )
298+ super ( context , helper )
308299 }
309300
310301 public result ( ) : ts . MethodDeclaration {
@@ -338,7 +329,7 @@ class ClassVisitor {
338329 }
339330 }
340331
341- return new MethodDecVisitor ( this . context , this . helper , node , this . classDec . name ) . result ( )
332+ return new MethodDecVisitor ( this . context , this . helper , node ) . result ( )
342333 }
343334
344335 if ( ts . isCallExpression ( node ) ) {
@@ -429,11 +420,10 @@ const tryGetStubbedFunctionName = (node: ts.CallExpression, helper: VisitorHelpe
429420 if ( sourceFileName && ! algotsModulePaths . some ( ( s ) => sourceFileName . includes ( s ) ) ) return undefined
430421 }
431422 const functionName = functionSymbol ?. getName ( ) ?? identityExpression . text
432- const stubbedFunctionNames = [ 'interpretAsArc4' , 'decodeArc4' , 'encodeArc4' , 'emit' , 'methodSelector' , 'abimethod' , 'baremethod' ]
423+ const stubbedFunctionNames = [ 'interpretAsArc4' , 'decodeArc4' , 'encodeArc4' , 'emit' , 'methodSelector' ]
433424 return stubbedFunctionNames . includes ( functionName ) ? functionName : undefined
434425}
435426
436427const isCallingDecodeArc4 = ( functionName : string | undefined ) : boolean => [ 'decodeArc4' , 'encodeArc4' ] . includes ( functionName ?? '' )
437428const isCallingEmit = ( functionName : string | undefined ) : boolean => 'emit' === ( functionName ?? '' )
438429const isCallingMethodSelector = ( functionName : string | undefined ) : boolean => 'methodSelector' === ( functionName ?? '' )
439- const isCallingDecoratorMethod = ( functionName : string | undefined ) : boolean => [ 'abimethod' , 'baremethod' ] . includes ( functionName ?? '' )
0 commit comments