A worker class which instantiates the new worker thread and and the managing class (DedicatedWorker)
What's Not Done
Some stuff from the API is not yet implemented:
Implementing the communication between Worker and WorkerGlobalScope via MessagePort objects...
implementing SharedWorker (which requires MessagePorts and may or may not be possible ... we'll see)
onerror handlers
The internal list of Documents that the API says the Worker keeps. That part seriously doesn't make sense to me.
The close() method of the worker which tells the WorkerGlobalScope to quit, etc.
The database methods available to WebWorkers via HTML5
Lessons Learned
A few items I learned working on this code:
Gears HttpRequest object does not support synchronous/blocking downloads. Solution is to prefetch what your worker needs and run the scripts as they are asked for, rather than ask, load and run.
Gears JS environment is missing some methods from Array object ... shift() and splice() didn't work for me at all.
Safari 4 native implementation of Worker doesn't support nested workers (inner/child workers)