Add JsInterpreter to replace Rhino usage#2812
Conversation
|
This should now be ready for review. I ran all the tests and they worked, fixed a couple things, and added a simpler API. |
…ange +more tests for some changed functionality
fire-light42
left a comment
There was a problem hiding this comment.
It looks like the JS interpreter does not handle the JSFuck obfuscation technique, which abuses easily overlooked parts of standard JS to obfuscate code, it should be very easy to generate test cases.
Would it be possible to support this or would it be too much scope creep? Even if it cannot be fully supported it might reveal some easy-to-fix edge cases.
|
It should be possible to support it although I am not entirely sure how at the moment. I aimed for this to support a lot of the standard JS spec, and didn't really go beyond it. I tried to support everything I found extensions using Rhino for and added test cases for some of those uses. I think if we do support it, we can, but perhaps should be a separate PR as that is kinda a different scope then what this was aiming for but up to you, I could look more into this this weekend though if you want. |
|
I will also do some testing on the real-world usage of the JS helpers to determine if this is required. Currently it does not seem like a blocker. |
I added 158 test cases for this, all of which pass locally. When adding tests I specifically targeted some common uses of rhino by extensions, and additionally added things extensions may want or need to use in the future. We can also expand those tests should something else come up in the future.