diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.cpp b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.cpp index 81d59fbca..910da12b8 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.cpp @@ -455,31 +455,36 @@ void setDOMException(ExecState* exec, ExceptionCode ec) if (!ec || exec->hadException()) return; + // FIXME: All callers to setDOMException need to pass in the right global object + // for now, we're going to assume the lexicalGlobalObject. Which is wrong in cases like this: + // frames[0].document.createElement(null, null); // throws an exception which should have the subframes prototypes. + JSDOMGlobalObject* globalObject = deprecatedGlobalObjectForPrototype(exec); + ExceptionCodeDescription description; getExceptionCodeDescription(ec, description); JSValue errorObject; switch (description.type) { case DOMExceptionType: - errorObject = toJS(exec, DOMCoreException::create(description)); + errorObject = toJS(exec, globalObject, DOMCoreException::create(description)); break; case RangeExceptionType: - errorObject = toJS(exec, RangeException::create(description)); + errorObject = toJS(exec, globalObject, RangeException::create(description)); break; case EventExceptionType: - errorObject = toJS(exec, EventException::create(description)); + errorObject = toJS(exec, globalObject, EventException::create(description)); break; case XMLHttpRequestExceptionType: - errorObject = toJS(exec, XMLHttpRequestException::create(description)); + errorObject = toJS(exec, globalObject, XMLHttpRequestException::create(description)); break; #if ENABLE(SVG) case SVGExceptionType: - errorObject = toJS(exec, SVGException::create(description).get(), 0); + errorObject = toJS(exec, globalObject, SVGException::create(description).get(), 0); break; #endif #if ENABLE(XPATH) case XPathExceptionType: - errorObject = toJS(exec, XPathException::create(description)); + errorObject = toJS(exec, globalObject, XPathException::create(description)); break; #endif } |