Bug 889830 - JavascriptException: TypeError: result[i].type r=etienne

see https://bugzilla.mozilla.org/show_bug.cgi?id=889830