Fix onerror handling when the browser passes an exception arg.
Merge pull request #190 from russelldavis/fix-onerror

Fix onerror handling when the browser passes an exception arg.