Bug 920425 part.4 Use mozilla::WidgetEvent::AsScriptErrorEvent() r=smaug

This commit is contained in:
Masayuki Nakano 2013-10-18 15:10:21 +09:00
parent 4f682bdaca
commit c084924124
2 changed files with 4 additions and 6 deletions

View File

@ -578,7 +578,7 @@ nsDOMEvent::DuplicatePrivateData()
case NS_SCRIPT_ERROR_EVENT:
{
InternalScriptErrorEvent* oldScriptErrorEvent =
static_cast<InternalScriptErrorEvent*>(mEvent);
mEvent->AsScriptErrorEvent();
InternalScriptErrorEvent* scriptErrorEvent =
new InternalScriptErrorEvent(false, msg);
scriptErrorEvent->AssignScriptErrorEventData(*oldScriptErrorEvent, true);

View File

@ -176,11 +176,9 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
Optional<uint32_t> columnNumber;
NS_ENSURE_TRUE(aEvent, NS_ERROR_UNEXPECTED);
WidgetEvent* event = aEvent->GetInternalNSEvent();
if (event->message == NS_LOAD_ERROR &&
event->eventStructType == NS_SCRIPT_ERROR_EVENT) {
InternalScriptErrorEvent *scriptEvent =
static_cast<InternalScriptErrorEvent*>(event);
InternalScriptErrorEvent* scriptEvent =
aEvent->GetInternalNSEvent()->AsScriptErrorEvent();
if (scriptEvent && scriptEvent->message == NS_LOAD_ERROR) {
errorMsg = scriptEvent->errorMsg;
msgOrEvent.SetAsString() = static_cast<nsAString*>(&errorMsg);