Chromium Code Reviews| Index: Source/bindings/v8/V8AbstractEventListener.cpp |
| diff --git a/Source/bindings/v8/V8AbstractEventListener.cpp b/Source/bindings/v8/V8AbstractEventListener.cpp |
| index f1f0c8aa7ea2b6925c1c6338417a4a8739945394..0164867d5592525511a5a553144580070e5259ce 100644 |
| --- a/Source/bindings/v8/V8AbstractEventListener.cpp |
| +++ b/Source/bindings/v8/V8AbstractEventListener.cpp |
| @@ -37,6 +37,7 @@ |
| #include "bindings/v8/V8Binding.h" |
| #include "bindings/v8/V8EventListenerList.h" |
| #include "bindings/v8/V8HiddenPropertyName.h" |
| +#include "core/dom/BeforeUnloadEvent.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/Event.h" |
| #include "core/dom/EventNames.h" |
| @@ -157,8 +158,8 @@ void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context |
| if (returnValue.IsEmpty()) |
| return; |
| - if (!returnValue->IsNull() && !returnValue->IsUndefined() && event->storesResultAsString()) |
| - event->storeResult(toWebCoreString(returnValue)); |
| + if (event->type() == eventNames().beforeunloadEvent && !returnValue->IsNull() && !returnValue->IsUndefined()) |
|
arv (Not doing code reviews)
2013/08/23 13:56:49
This doesn't look safe. What if someone dispatches
do-not-use
2013/08/23 14:20:40
Oops, you're right. I believe the most common patt
do-not-use
2013/08/23 14:27:54
Done.
|
| + static_cast<BeforeUnloadEvent*>(event)->setReturnValue(toWebCoreString(returnValue)); |
| if (m_isAttribute && shouldPreventDefault(returnValue)) |
| event->preventDefault(); |