-
Notifications
You must be signed in to change notification settings - Fork 143
[css-paint][isolated-workers] What happens if a script throws? #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Why would that be necessary? Errors don't corrupt the scripting environment, they just tear down the call stack until they're caught (or land at the top scripting context). An error will just invalidate that particular call; the next one will start fresh.
Workers can be restarted in a single frame step; they can be restarted arbitrarily. Between every single invocation, possibly. There is no reliable way to "stash" information between calls, and we're actively seeking to require low-impact ways to make this less reliable, like using a pool of contexts and randomly switching between them between calls. |
The issue I had in mind is that the script being stopped at some random point in execution may leave a buggy environment around it (globals or scope-local globals incorrectly set, caches filled with buggy values, etc...), which may cause ulterior failures. Maybe I'm overthinking this issue though, but I wanted to make sure someone else gave it some thought, too. |
Your script shouldn't be messing with the global environment in the first place; doing it at all is a mistake, and if you fuck yourself up by getting an error before you can clean up, that's your own fault. |
Ok, good pooint |
Initial draft of AnimationWorklet spec.
This could have an impact on other scripts running in the background worker.
Should we restart the environement after such an error or not?
That's important to know for scripts which may want to share data because if the worker can be restarted during a single-frame step, there's no way to accurately pass information from one script to another (or one run to another).
The text was updated successfully, but these errors were encountered: