12012-05-10 Erik Arvidsson <arv@chromium.org>
2
3 Make DOM Exceptions Errors
4 https://bugs.webkit.org/show_bug.cgi?id=85078
5
6 Reviewed by NOBODY (OOPS!).
7
8 WebIDL mandates that exceptions should have Error.prototype on its prototype chain.
9
10 For JSC we have access to the Error.prototype (and Array.prototype) from the binding code.
11
12 For V8 we set a field in the WrapperTypeInfo and when the constructor function is created we
13 set the prototype as needed.
14
15 This patch also adds support for [ArrayClass] since that code is almost identical. It does not
16 however use [ArrayClass] in any places yet.
17
18 Updated test: fast/dom/DOMException/prototype-object.html
19
20 * ForwardingHeaders/runtime/ErrorPrototype.h: Added.
21 * bindings/scripts/CodeGeneratorJS.pm:
22 (GenerateHeader):
23 (GenerateImplementation):
24 * bindings/scripts/CodeGeneratorV8.pm:
25 (GenerateNamedConstructorCallback):
26 (GenerateImplementation):
27 * bindings/scripts/IDLAttributes.txt:
28 * bindings/scripts/test/JS/JSFloat64Array.h:
29 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
30 (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
31 (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
32 * bindings/scripts/test/JS/JSTestException.cpp:
33 (WebCore::JSTestException::createPrototype):
34 * bindings/scripts/test/JS/JSTestException.h:
35 * bindings/scripts/test/JS/JSTestNode.h:
36 * bindings/scripts/test/JS/JSTestObj.cpp:
37 (WebCore::JSTestObj::createPrototype):
38 (WebCore::jsTestObjPrototypeFunctionAddEventListener):
39 (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
40 * bindings/scripts/test/JS/JSTestObj.h:
41 * bindings/scripts/test/TestObj.idl:
42 * bindings/scripts/test/V8/V8Float64Array.cpp:
43 (WebCore):
44 * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
45 (WebCore):
46 * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
47 (WebCore):
48 * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
49 (WebCore):
50 * bindings/scripts/test/V8/V8TestEventTarget.cpp:
51 (WebCore):
52 * bindings/scripts/test/V8/V8TestException.cpp:
53 (WebCore):
54 (WebCore::V8TestException::wrapSlow):
55 * bindings/scripts/test/V8/V8TestException.h:
56 (WebCore::V8TestException::wrap):
57 * bindings/scripts/test/V8/V8TestInterface.cpp:
58 (WebCore):
59 * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
60 (WebCore):
61 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
62 (WebCore):
63 * bindings/scripts/test/V8/V8TestNode.cpp:
64 (WebCore):
65 * bindings/scripts/test/V8/V8TestObj.cpp:
66 (WebCore):
67 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
68 (WebCore):
69 * bindings/v8/NPV8Object.cpp:
70 (WebCore::npObjectTypeInfo):
71 * bindings/v8/V8BindingPerContextData.cpp:
72 (WebCore):
73 (WebCore::V8BindingPerContextData::init):
74 (WebCore::V8BindingPerContextData::createWrapperFromCacheSlowCase):
75 (WebCore::V8BindingPerContextData::constructorForTypeSlowCase):
76 * bindings/v8/V8BindingPerContextData.h:
77 (V8BindingPerContextData):
78 * bindings/v8/V8HiddenPropertyName.h:
79 (WebCore):
80 * bindings/v8/WrapperTypeInfo.h:
81 (WebCore):
82 (WrapperTypeInfo):
83 * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
84 (WebCore):
85