We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
比如 文件 a.dart 里面有 TestClassA 类里面有loadSuccess方法 文件b.dart里面有 TestClassB 类里面也有loadSuccess方法
我注入了a.dart 里面的loadSuccess方法,但是b.dart里面的方法却会触发
The text was updated successfully, but these errors were encountered:
@execute("package:test/app/modules/test1_module/test1_controller.dart","Test1Controller","-onReady") @pragma("vm:entry-point") void onReady(PointCut pointcut) { Log.d('Test1Controller onReady',tag: LOG_TAG_INJECT); pointcut.proceed(); }
@execute("package:test/app/modules/test2_module/test2_controller.dart","Test2Controller","-onReady") @pragma("vm:entry-point") void onReady2(PointCut pointcut) { Log.d('Test2Controller onReady',tag: LOG_TAG_INJECT); pointcut.proceed(); } }
发现注入了相同的方法,两个类中都有onReady方法,但是本来应该触发下面的,却出发了上面的.
Sorry, something went wrong.
修改了一下源码,解决了这个问题,在调用visitProcedure的时候添加了clsName的检测
@OverRide void visitProcedure(Procedure node) { String procedureName = node.name.name; bool needCompareClass = false; Class originalClass = null; if(node.parent is Class){ needCompareClass = true; originalClass = node.parent; } String clsName = null; if(needCompareClass){ clsName = originalClass.name; }
AopItemInfo matchedAopItemInfo; int aopItemInfoListLen = _aopItemInfoList.length; for (int i = 0; i < aopItemInfoListLen && matchedAopItemInfo == null; i++) { AopItemInfo aopItemInfo = _aopItemInfoList[i]; if ((aopItemInfo.isRegex && RegExp(aopItemInfo.methodName).hasMatch(procedureName)) || (!aopItemInfo.isRegex && procedureName == aopItemInfo.methodName )) { if(needCompareClass){ if(aopItemInfo.clsName == clsName){ matchedAopItemInfo = aopItemInfo; break; } }else{ matchedAopItemInfo = aopItemInfo; break; } } } if (matchedAopItemInfo == null) { return; }
No branches or pull requests
比如 文件 a.dart 里面有 TestClassA 类里面有loadSuccess方法
文件b.dart里面有 TestClassB 类里面也有loadSuccess方法
我注入了a.dart 里面的loadSuccess方法,但是b.dart里面的方法却会触发
The text was updated successfully, but these errors were encountered: