diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/bindings/js/JSDocumentCustom.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/bindings/js/JSDocumentCustom.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSDocumentCustom.cpp b/src/3rdparty/webkit/WebCore/bindings/js/JSDocumentCustom.cpp index f292b388ae..316252a5d1 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/JSDocumentCustom.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/JSDocumentCustom.cpp @@ -55,7 +55,14 @@ JSValuePtr JSDocument::location(ExecState* exec) const if (!frame) return jsNull(); - return toJS(exec, frame->domWindow()->location()); + Location* location = frame->domWindow()->location(); + if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec->globalData(), location)) + return wrapper; + + JSDOMWindow* window = static_cast<JSDOMWindow*>(exec->lexicalGlobalObject()); + JSLocation* jsLocation = new (exec) JSLocation(getDOMStructure<JSLocation>(exec, window), location); + cacheDOMObjectWrapper(exec->globalData(), location, jsLocation); + return jsLocation; } void JSDocument::setLocation(ExecState* exec, JSValuePtr value) |