Open hyllee opened 4 years ago
@hyllee most features introduced in ECMAScript 2015 and after are not support by Jalangi. Can you run your code through Babel first and then run the result through Jalangi?
@msridhar thanks for the suggestion. Indeed we are also trying to use Babel for ECMAScript 2015 features. But given the complexity of our applications, that might not be the solution at the end. Apart from that, we didn't expect unhandled exceptions in Jalangi2 due to lack of support for a feature. We have noticed that the 0.2.5
release does not throw the exception. So it could possibly be due to a change in 0.2.6
?
In general, I think it would make sense to make sure the unsupported features don't get instrumented and the code runs correctly.
In 0.2.6
I updated some dependencies (like the acorn parser) from extremely old versions. It's possible that's what caused the problem. I agree it would be great if Jalangi at least didn't break code with unsupported features. I would welcome a PR here to fix this issue. All the instrumentation code is in this file. It would take a bit of time to understand but shouldn't be too bad. I am happy to explain parts that are tricky.
Unhandled exception from array destructuring assignment
Destructuring assignment syntax is not supported and results in an exception in version v0.2.6. This results in the instrumentor to crash and not produce any outputs.
Stack trace:
Invalid code generated from object destructuring assignment
Another issue with destructuring assignment where it does not throw an exception but outputs syntactically invalid code:
which is transformed into something in the likes of the following:
This, when run, results in a syntax error at line 2:
Uncaught SyntaxError: Unexpected token '.'