12011-12-18 Kentaro Hara <haraken@chromium.org>
2
3 REGRESSION(r101445): [JSC] Generated code for custom getters and setters
4 with the [Supplemental] IDL is wrong
5 https://bugs.webkit.org/show_bug.cgi?id=74837
6
7 Reviewed by NOBODY (OOPS!).
8
9 In bug 73162, we implemented the [Supplemental] IDL, but the generated code
10 for custom getters and setters was wrong in JSC. This patch fixes CodeGeneratorJS.pm
11 so that the result of WebCore/bindings/scripts/test/TestInterface.idl becomes as follows:
12
13 Wrong:
14 JSValue jsTestInterfaceStr3(ExecState* exec, JSValue slotBase, const Identifier&)
15 {
16 JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
17 return JSTestSupplemental::str3(castedThis, exec);
18 }
19
20 Correct:
21 JSValue jsTestInterfaceStr3(ExecState* exec, JSValue slotBase, const Identifier&)
22 {
23 JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
24 TestInterface* imp = static_cast<TestInterface*>(castedThis->impl());
25 return castedThis->str3(imp, exec);
26 }
27
28 Tests: bindings/scripts/test/JS/TestInterface.idl
29
30 * bindings/scripts/CodeGeneratorJS.pm:
31 (GenerateHeader):
32 (GenerateImplementation):
33 * bindings/scripts/test/JS/JSTestInterface.cpp: Updated run-bindings-tests result.
34 (WebCore::jsTestInterfaceStr3):
35 (WebCore::setJSTestInterfaceStr3):
36 * bindings/scripts/test/JS/JSTestInterface.h: Ditto.
37