Bug 935692: Don't try to fire error events on non-DOM globals. r=bent

This commit is contained in:
Kyle Huey 2013-12-09 13:59:15 -08:00
Родитель 28a5b72edd
Коммит c097e70a19
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -1211,8 +1211,7 @@ public:
bool preventDefaultCalled;
nsIScriptGlobalObject* sgo;
if (aWorkerPrivate ||
!(sgo = nsJSUtils::GetStaticScriptGlobal(target))) {
if (aWorkerPrivate) {
WorkerGlobalScope* globalTarget = aWorkerPrivate->GlobalScope();
MOZ_ASSERT(target == globalTarget->GetWrapperPreserveColor());
@ -1233,7 +1232,7 @@ public:
preventDefaultCalled = status == nsEventStatus_eConsumeNoDefault;
}
else {
else if ((sgo = nsJSUtils::GetStaticScriptGlobal(target))) {
// Icky, we have to fire an InternalScriptErrorEvent...
InternalScriptErrorEvent event(true, NS_LOAD_ERROR);
event.lineNr = aLineNumber;