Index: Source/bindings/v8/custom/V8PopStateEventCustom.cpp |
diff --git a/Source/bindings/v8/custom/V8PopStateEventCustom.cpp b/Source/bindings/v8/custom/V8PopStateEventCustom.cpp |
index ba93201f6fbc55512f4108480b737ee5fc722a43..af14e0b84a8bbf4a842b6411189a2940e1e93358 100644 |
--- a/Source/bindings/v8/custom/V8PopStateEventCustom.cpp |
+++ b/Source/bindings/v8/custom/V8PopStateEventCustom.cpp |
@@ -58,7 +58,16 @@ void V8PopStateEvent::stateAttrGetterCustom(v8::Local<v8::String> name, const v8 |
PopStateEvent* event = V8PopStateEvent::toNative(info.Holder()); |
History* history = event->history(); |
if (!history || !event->serializedState()) { |
- v8SetReturnValue(info, cacheState(info.Holder(), v8::Null(info.GetIsolate()))); |
+ if (!event->serializedState()) { |
+ v8::Local<v8::Value> mainWorldState = getHiddenValueFromMainWorldWrapper(info.GetIsolate(), event, V8HiddenPropertyName::state()); |
+ if (!mainWorldState.IsEmpty()) |
+ event->setSerializedState(SerializedScriptValue::createSwallowExceptions(mainWorldState, info.GetIsolate())); |
+ } |
+ if (event->serializedState()) |
+ result = event->serializedState()->deserialize(); |
+ else |
+ result = v8::Null(info.GetIsolate()); |
+ v8SetReturnValue(info, cacheState(info.Holder(), result)); |
return; |
} |
@@ -81,8 +90,9 @@ void V8PopStateEvent::stateAttrGetterCustom(v8::Local<v8::String> name, const v8 |
} |
result = event->serializedState()->deserialize(info.GetIsolate()); |
v8History->SetHiddenValue(V8HiddenPropertyName::state(), result); |
- } else |
+ } else { |
result = event->serializedState()->deserialize(info.GetIsolate()); |
+ } |
v8SetReturnValue(info, cacheState(info.Holder(), result)); |
} |