Index: Source/bindings/v8/V8AbstractEventListener.cpp |
diff --git a/Source/bindings/v8/V8AbstractEventListener.cpp b/Source/bindings/v8/V8AbstractEventListener.cpp |
index e6937c99d53f9f2caf60cd433dde6f810d0f6471..e6b3de91b411885d3368a198eb5479c802da8b5e 100644 |
--- a/Source/bindings/v8/V8AbstractEventListener.cpp |
+++ b/Source/bindings/v8/V8AbstractEventListener.cpp |
@@ -156,8 +156,10 @@ void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context |
if (returnValue.IsEmpty()) |
return; |
- if (!returnValue->IsNull() && !returnValue->IsUndefined() && event->isBeforeUnloadEvent()) |
- toBeforeUnloadEvent(event)->setReturnValue(toWebCoreString(returnValue)); |
+ if (!returnValue->IsNull() && !returnValue->IsUndefined() && event->isBeforeUnloadEvent()) { |
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringReturnValue, returnValue); |
+ toBeforeUnloadEvent(event)->setReturnValue(stringReturnValue); |
+ } |
if (m_isAttribute && shouldPreventDefault(returnValue)) |
event->preventDefault(); |