REGRESSION(r101445): [JSC] Generated code for custom getters and setters
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Dec 2011 07:15:58 +0000 (07:15 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Dec 2011 07:15:58 +0000 (07:15 +0000)
commit87f6835ed337c90620cc7d18594970cda291b7fd
tree14380faaddb11b64edf7704e9b61830657c304a9
parentb4fd29d94464eb91d2bc66b6e3e9044a533f8ed9
REGRESSION(r101445): [JSC] Generated code for custom getters and setters
with the [Supplemental] IDL is wrong
https://bugs.webkit.org/show_bug.cgi?id=74837

Reviewed by Darin Adler.

In bug 73162, we implemented the [Supplemental] IDL, but the generated code
for custom getters and setters was wrong in JSC. This patch fixes CodeGeneratorJS.pm
so that the result of WebCore/bindings/scripts/test/TestInterface.idl becomes as follows:

Wrong:
    JSValue jsTestInterfaceStr3(ExecState* exec, JSValue slotBase, const Identifier&)
    {
        JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
        return JSTestSupplemental::str3(castedThis, exec);
    }

Correct:
    JSValue jsTestInterfaceStr3(ExecState* exec, JSValue slotBase, const Identifier&)
    {
        JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
        TestInterface* imp = static_cast<TestInterface*>(castedThis->impl());
        return castedThis->str3(imp, exec);
    }

Tests: bindings/scripts/test/JS/TestInterface.idl

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestInterface.cpp: Updated run-bindings-tests result.
(WebCore::jsTestInterfaceStr3):
(WebCore::setJSTestInterfaceStr3):
* bindings/scripts/test/JS/JSTestInterface.h: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h