Bug 52116 javascript strict warning/error doesn't always contain Source File filename

handle onfoo inline event listeners
r=bz sr=bz
This commit is contained in:
timeless%mozdev.org 2004-07-17 00:28:35 +00:00
Родитель 9035b8ea4a
Коммит fd9b3c984a
1 изменённых файлов: 13 добавлений и 7 удалений

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

@ -1129,16 +1129,22 @@ nsEventListenerManager::AddScriptEventListener(nsISupports *aObject,
context = global->GetContext(); context = global->GetContext();
} }
} else { } else {
doc = do_QueryInterface(aObject); nsCOMPtr<nsIDOMWindow> win(do_QueryInterface(aObject));
nsCOMPtr<nsIScriptGlobalObject> global; nsCOMPtr<nsIScriptGlobalObject> global;
if (win) {
if (doc) { nsCOMPtr<nsIDOMDocument> domdoc;
global = doc->GetScriptGlobalObject(); win->GetDocument(getter_AddRefs(domdoc));
doc = do_QueryInterface(domdoc);
global = do_QueryInterface(win);
} else { } else {
global = do_QueryInterface(aObject); doc = do_QueryInterface(aObject);
}
if (doc) {
global = doc->GetScriptGlobalObject();
} else {
global = do_QueryInterface(aObject);
}
}
if (global) { if (global) {
context = global->GetContext(); context = global->GetContext();
} }