There are a number of functions defined at global scope in WorkerContext - for example, setTimeout() and postMessage() are both defined in the worker global context. It's perfectly valid for worker code to do this: postMessage("hello"); However, if the worker code does this instead, it gets a TypeError: var saved = postMessage; saved("hello");
The test case works in Chromium, so it's somewhere in the JSC bindings.
On a related note, the following line of code from Worker Context results in a TypeError also: postMessage.call(null, "foobar");
Created attachment 33094 [details] test case test case that shows this problem (passes on FF/Chrome, fails on Safari 4)
Created attachment 33209 [details] proposed patch This is dependent on 27420 as it relies on the IsWorkerContext attribute added in that patch.
Comment on attachment 33209 [details] proposed patch Awesome. Thanks for the patch.
assingning to me for landing
Landed: http://trac.webkit.org/changeset/46371