The above javascript shell is broken, works fine in several other browsers.
The JavaScript shell now works in Safari 3.02 and ToT. I tried a random sampling of the nightlies that work with Safari 3, and it seems to be fixed in every one of them. I'll try to hunt down the exact change that fixed it when I have the time.
Marking RESOVLED/FIXED per Comment #1.