summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/port/bindings/v8/v8_proxy.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp
index 6cffe3a..46bff01 100644
--- a/webkit/port/bindings/v8/v8_proxy.cpp
+++ b/webkit/port/bindings/v8/v8_proxy.cpp
@@ -1842,6 +1842,14 @@ void V8Proxy::UpdateDocumentWrapperCache()
}
v8::Handle<v8::Value> document_wrapper = NodeToV8Object(m_frame->document());
+
+ // If instantiation of the document wrapper fails, clear the cache
+ // and let the DOMWindow accessor handle access to the document.
+ if (document_wrapper.IsEmpty()) {
+ ClearDocumentWrapperCache();
+ return;
+ }
+
m_context->Global()->ForceSet(v8::String::New("document"),
document_wrapper,
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));