Conversation
|
@dusan-dragon thanks for commit! Could you attach an example of code or (better) a test case that works only with your fix? |
|
Current output on obfuscator.io is |
|
Added test which fails on master but passes on this branch |
|
@zamotkin I will try but not sure If I will be able to create such an example as the current obfuscated code is quite complicated and we use more general regex for reserved strings as narrowing down what exactly is the issue is taking too much time |
|
@dusan-dragon sorry, I can't understand what issue you are trying to solve, I need more details. |
|
I do not know what is exactly the issue but my obfuscated code will not run without this in react native. |
|
Thank you for the PR. I'll reimplement this fix in slightly different way, to work with other literal transformers, so, i'll close this PR in favor of my pr |
Changed
isReservedStringfrom private to public onStringLiteralObfuscatingReplacerand added check for reserved strings before calling replace.I do not fully understand what the StringLiteralObfuscatingReplacer is doing (did not spend that much time in the code) but it seems it will modify strings in the code even if they are included in
reservedStringsoptions.I am creating this PR because we want to use this library in react-native project but when this is modifying reserver strings it will crash our application it wont even start. With this "fix" it works.
Please take a look, it is kind of modifying the output produced by this library, but only 1 test was failing so not sure what impact it can have. Thank you