If Worker.terminate() is called before the worker thread has begun execution, it cannot forbid script execution. So, evaluating the script source can result in the thread entering a loop forever, taking 100% of processor (core) time.
Created attachment 26900 [details] proposed patch
Comment on attachment 26900 [details] proposed patch r=me
Created attachment 26924 [details] Alternative patch I changed my mind - I now think it's better to go through the normal code path, to avoid getting out of sync in the future. It's slightly less efficient, but this use case is definitely not something to optimize for.
Committed revision 40159.