Skip to content
  • arv@chromium.org's avatar
    Make DOM Exceptions Errors · 31fddbcd
    arv@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=85078
    
    Reviewed by Oliver Hunt.
    
    WebIDL mandates that exceptions should have Error.prototype on its prototype chain.
    
    For JSC we have access to the Error.prototype from the binding code.
    
    For V8 we set a field in the WrapperTypeInfo and when the constructor function is created we
    set the prototype as needed.
    
    Updated test: fast/dom/DOMException/prototype-object.html
    
    Source/JavaScriptCore:
    
    * JavaScriptCore.xcodeproj/project.pbxproj:
    * runtime/JSGlobalObject.cpp:
    (JSC::JSGlobalObject::reset):
    * runtime/JSGlobalObject.h:
    (JSC):
    (JSGlobalObject):
    (JSC::JSGlobalObject::errorPrototype):
    
    Source/WebCore:
    
    * ForwardingHeaders/runtime/ErrorPrototype.h: Added.
    * bindings/scripts/CodeGeneratorJS.pm:
    (GenerateHeader):
    (GenerateImplementation):
    * bindings/scripts/CodeGeneratorV8.pm:
    (GenerateNamedConstructorCallback):
    (GenerateImplementation):
    * bindings/scripts/test/JS/JSTestException.cpp:
    (WebCore::JSTestException::createPrototype):
    * bindings/scripts/test/JS/JSTestException.h:
    * bindings/scripts/test/V8/V8Float64Array.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestEventTarget.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestException.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestInterface.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestNode.cpp:
    (WebCore):
    * bindings/scripts/test/V8/V8TestObj.cpp:
    (WebCore):
    (WebCore::V8TestObj::installPerContextProperties):
    * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
    (WebCore):
    * bindings/v8/NPV8Object.cpp:
    (WebCore::npObjectTypeInfo):
    * bindings/v8/V8BindingPerContextData.cpp:
    (WebCore):
    (WebCore::V8BindingPerContextData::init):
    (WebCore::V8BindingPerContextData::createWrapperFromCacheSlowCase):
    (WebCore::V8BindingPerContextData::constructorForTypeSlowCase):
    * bindings/v8/V8BindingPerContextData.h:
    (V8BindingPerContextData):
    * bindings/v8/V8HiddenPropertyName.h:
    (WebCore):
    * bindings/v8/WrapperTypeInfo.h:
    (WebCore):
    (WrapperTypeInfo):
    * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
    (WebCore):
    
    LayoutTests:
    
    * fast/dom/DOMException/prototype-object-expected.txt:
    * fast/dom/DOMException/prototype-object.html:
    * fast/dom/DOMException/resources/prototype-object.js: Removed.
    * platform/chromium-win/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt: Removed.
    * platform/chromium-win/fast/dom/timer-clear-interval-in-handler-and-generate-error-expected.txt: Removed.
    * platform/chromium-win/svg/filters/feBlend-invalid-mode-expected.txt: Removed.
    * platform/chromium/dom/xhtml/level3/core/documentnormalizedocument10-expected.txt: Added.
    * platform/chromium/dom/xhtml/level3/core/documentsetxmlversion03-expected.txt: Added.
    * platform/chromium/fast/dom/DOMException/prototype-object-expected.txt:
    * platform/chromium/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt: Renamed from LayoutTests/platform/chromium-mac/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt.
    * platform/chromium/fast/dom/timer-clear-interval-in-handler-and-generate-error-expected.txt: Renamed from LayoutTests/platform/chromium-mac/fast/dom/timer-clear-interval-in-handler-and-generate-error-expected.txt.
    * platform/chromium/svg/filters/feBlend-invalid-mode-expected.txt: Renamed from LayoutTests/platform/chromium-mac/svg/filters/feBlend-invalid-mode-expected.txt.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    31fddbcd