Add nsScriptError, and make nsConsoleService implement nsIScriptErrorLogger for logging script errors. I do it this way to leave open the possibility of e.g. an nsIXMLErrorLogger interface later on.
Make getMessageArray return an empty array (rather than null) when there are no mmessages, and change console.js to expect this (but check against null anyway.)