Dart, reflection and source maps?

I have a proxy object that uses noSuchMethodto transfer calls to other objects, but the proxy object exists in a minified / obfuscated environment, and the objects to which it transfers calls are in a non-minified / confused state, so when the name of the called method reaches a non-minified environment, the names do not match, I have the file myFile.dart.js.map, is there a simple algorithm for analyzing it and getting the original name of the call back from the searched name using the source maps? or is it even better to have a library that already does this in a dart?

+4
source share
1 answer

You can use MirrorSystem.getName to get the real name of the symbol. In case of noSuchMethod:

noSuchMethod(Invocation invocation) {
  String member = MirrorSystem.getName(invocation.memberName);
}
+3
source

Source: https://habr.com/ru/post/1527311/


All Articles