JSValue JSDOMWindow::location(ExecState* exec) const { Location* location = impl()->location(); if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec->globalData(), location)) return wrapper; JSLocation* jsLocation = new (exec) JSLocation(getDOMStructure<JSLocation>(exec, const_cast<JSDOMWindow*>(this)), location); cacheDOMObjectWrapper(exec->globalData(), location, jsLocation); return jsLocation; }
JSValue JSDOMWindow::history(ExecState* exec) const { History* history = impl()->history(); if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec->globalData(), history)) return wrapper; JSHistory* jsHistory = new (exec) JSHistory(getDOMStructure<JSHistory>(exec, const_cast<JSDOMWindow*>(this)), history); cacheDOMObjectWrapper(exec->globalData(), history, jsHistory); return jsHistory; }
JSValue JSDocument::location(ExecState* exec) const { Frame* frame = static_cast<Document*>(impl())->frame(); if (!frame) return jsNull(); Location* location = frame->domWindow()->location(); if (DOMObject* wrapper = getCachedDOMObjectWrapper(exec, location)) return wrapper; JSLocation* jsLocation = new (exec) JSLocation(getDOMStructure<JSLocation>(exec, globalObject()), globalObject(), location); cacheDOMObjectWrapper(exec, location, jsLocation); return jsLocation; }