mitro-co/mitro — pull request #69 by ahilss (2014-10-12 07:19:14+00:00)
Title: Fix Firefox 32

Event objects passed into page_worker message handlers now appear to be immutable in FF32. We were mutating the event object by adding a setResponse function and replacing _callback_x strings in the message args with onSuccess and onError handlers. This is why we were seeing exceptions about onError being undefined. Making a deep copy of the message data fixes the issue.

It looks like events passed in contexts other than page_worker are still mutable, but we should still fix them to protect against changes like this in the future. Mutating input parameters is a bad idea, especially when those parameters come from third-party code.