Open infra-0-0 opened 8 years ago
Webworkers are isolated from the main context. I'm looking to somehow bridge it to allow the code to run, though I'm pretty sure I have no hope of getting data out. @msridhar any comment on this issue?
@stroucki what is your goal exactly? As you note, webworkers are isolated and can only communicate via message passing. You could probably move data around by creating appropriate message handlers via your analysis and then passing data around in the endExecution()
callback. But it would be some work.
@msridhar I would like to instrument the javascript of a large commercial site, using jalangi via a proxy. The proxy instruments the code, but if it is running in a worker, it dies immediately from the undefined reference.
The site renders without the worker working, but I'm trying to be as complete as I can be.
Thanks for the details. This seems tricky to fix. One solution would be to load the core Jalangi runtime scripts (and the analysis scripts) within each worker. But, in the proxy, I don't think you can tell whether a script will be loaded in the main context or within a worker. If there were some way to tell, that would be useful. Otherwise, I don't immediately have an idea on how to solve this.
I am currently thinking of adding a check for J$ being undefined at the beginning of a script, and trying to set up J$ accordingly if so.
Let us know if you are successful!
On Oct 14, 2021 at 2:00:46 PM, stroucki @.***> wrote:
I am currently thinking of adding a check for J$ being undefined at the beginning of a script, and trying to set up J$ accordingly if so.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Samsung/jalangi2/issues/87#issuecomment-943728483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABPEUIGDXFTKWYI6B3TSK3UG5AH5ANCNFSM4B44EKUQ .
Possibly a bug in Jalangi2.
Expected behavior:
Actual behavior:
"ReferenceError: J$ is not defined"