Changeset 123433 in webkit


Ignore:
Timestamp:
Jul 24, 2012 12:21:25 AM (12 years ago)
Author:
haraken@chromium.org
Message:

[JSC] REGRESSION(r122912): CodeGeneratorJS.pm should not
implicitly assume ScriptExecutionContext for static attributes
https://bugs.webkit.org/show_bug.cgi?id=91924

Reviewed by Adam Barth.

r122912 implemented static attributes in CodeGeneratorJS.pm.
However, the generated code assumes that static attributes
always require ScriptExecutionContext, which is wrong.
If we need a ScriptExecutionContext, we should specify
[CallWith=ScriptExecutionContext].

This patch fixes CodeGeneratorJS.pm so that static attributes
do not assume ScriptExecutionContext. This fix aligns with
the fix in CodeGeneratorV8.pm in r123308.

Test: bindings/scripts/test/TestObj.idl

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):

  • bindings/scripts/test/JS/JSTestInterface.cpp:

(WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
(WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):

  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::jsTestObjConstructorStaticReadOnlyIntAttr):
(WebCore::jsTestObjConstructorStaticStringAttr):
(WebCore::setJSTestObjConstructorStaticStringAttr):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r123429 r123433  
     12012-07-24  Kentaro Hara  <haraken@chromium.org>
     2
     3        [JSC] REGRESSION(r122912): CodeGeneratorJS.pm should not
     4        implicitly assume ScriptExecutionContext for static attributes
     5        https://bugs.webkit.org/show_bug.cgi?id=91924
     6
     7        Reviewed by Adam Barth.
     8
     9        r122912 implemented static attributes in CodeGeneratorJS.pm.
     10        However, the generated code assumes that static attributes
     11        always require ScriptExecutionContext, which is wrong.
     12        If we need a ScriptExecutionContext, we should specify
     13        [CallWith=ScriptExecutionContext].
     14
     15        This patch fixes CodeGeneratorJS.pm so that static attributes
     16        do not assume ScriptExecutionContext. This fix aligns with
     17        the fix in CodeGeneratorV8.pm in r123308.
     18
     19        Test: bindings/scripts/test/TestObj.idl
     20
     21        * bindings/scripts/CodeGeneratorJS.pm:
     22        (GenerateImplementation):
     23        * bindings/scripts/test/JS/JSTestInterface.cpp:
     24        (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
     25        (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
     26        (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
     27        * bindings/scripts/test/JS/JSTestObj.cpp:
     28        (WebCore::jsTestObjConstructorStaticReadOnlyIntAttr):
     29        (WebCore::jsTestObjConstructorStaticStringAttr):
     30        (WebCore::setJSTestObjConstructorStaticStringAttr):
     31
    1322012-07-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    233
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r122912 r123433  
    17721772                push(@implContent, "{\n");
    17731773
    1774                 if ($attribute->isStatic) {
    1775                     push(@implContent, "    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
    1776                     push(@implContent, "    if (!scriptContext)\n");
     1774                if (!$attribute->isStatic) {
     1775                    push(@implContent, "    ${className}* castedThis = jsCast<$className*>(asObject(slotBase));\n");
     1776                }
     1777
     1778                if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
     1779                    $needsMarkChildren = 1;
     1780                }
     1781
     1782                if ($dataNode->extendedAttributes->{"CheckSecurity"} &&
     1783                    !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} &&
     1784                    !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) {
     1785                    push(@implContent, "    if (!castedThis->allowsAccessFrom(exec))\n");
    17771786                    push(@implContent, "        return jsUndefined();\n");
    1778                     push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "${implClassName}::$implGetterFunctionName(scriptContext)", "") . ";\n");
     1787                }
     1788
     1789                if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) {
     1790                    push(@implContent, "    return castedThis->$implGetterFunctionName(exec);\n");
     1791                } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
     1792                    $implIncludes{"JSDOMBinding.h"} = 1;
     1793                    push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
     1794                    push(@implContent, "    return shouldAllowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsNull();\n");
     1795                } elsif ($type eq "EventListener") {
     1796                    $implIncludes{"EventListener.h"} = 1;
     1797                    push(@implContent, "    UNUSED_PARAM(exec);\n");
     1798                    push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
     1799                    push(@implContent, "    if (EventListener* listener = impl->$implGetterFunctionName()) {\n");
     1800                    push(@implContent, "        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n");
     1801                    if ($implClassName eq "Document" || $implClassName eq "WorkerContext" || $implClassName eq "SharedWorkerContext" || $implClassName eq "DedicatedWorkerContext") {
     1802                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl))\n");
     1803                    } else {
     1804                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl->scriptExecutionContext()))\n");
     1805                    }
     1806                    push(@implContent, "                return jsFunction;\n");
     1807                    push(@implContent, "        }\n");
     1808                    push(@implContent, "    }\n");
     1809                    push(@implContent, "    return jsNull();\n");
     1810                } elsif ($attribute->signature->type =~ /Constructor$/) {
     1811                    my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
     1812                    $constructorType =~ s/Constructor$//;
     1813                    # Constructor attribute is only used by DOMWindow.idl, so it's correct to pass castedThis as the global object
     1814                    # Once JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
     1815                    push(@implContent, "    return JS" . $constructorType . "::getConstructor(exec, castedThis);\n");
     1816                } elsif (!@{$attribute->getterExceptions}) {
     1817                    push(@implContent, "    UNUSED_PARAM(exec);\n") if !$attribute->signature->extendedAttributes->{"CallWith"};
     1818
     1819                    my $cacheIndex = 0;
     1820                    if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
     1821                        $cacheIndex = $currentCachedAttribute;
     1822                        $currentCachedAttribute++;
     1823                        push(@implContent, "    if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
     1824                        push(@implContent, "        return cachedValue;\n");
     1825                    }
     1826
     1827                    my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()");
     1828
     1829                    if ($svgListPropertyType) {
     1830                        push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "castedThis->impl()->$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
     1831                    } elsif ($svgPropertyOrListPropertyType) {
     1832                        push(@implContent, "    $svgPropertyOrListPropertyType& impl = castedThis->impl()->propertyReference();\n");
     1833                        if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
     1834                            push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl", "castedThis") . ";\n");
     1835                        } else {
     1836                            push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
     1837
     1838                        }
     1839                    } else {
     1840                        my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
     1841                        if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
     1842                            my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
     1843                            $implIncludes{"${implementedBy}.h"} = 1;
     1844                            $functionName = "${implementedBy}::${functionName}";
     1845                            unshift(@arguments, "impl");
     1846                        } elsif ($attribute->isStatic) {
     1847                            $functionName = "${implClassName}::${functionName}";
     1848                        } else {
     1849                            $functionName = "impl->${functionName}";
     1850                        }
     1851
     1852                        unshift(@arguments, @callWithArgs);
     1853
     1854                        my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
     1855                        push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n") if !$attribute->isStatic;
     1856                        if ($codeGenerator->IsSVGAnimatedType($type)) {
     1857                            push(@implContent, "    RefPtr<$type> obj = $jsType;\n");
     1858                            push(@implContent, "    JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());\n");
     1859                        } else {
     1860                            push(@implContent, "    JSValue result = $jsType;\n");
     1861                        }
     1862                    }
     1863
     1864                    push(@implContent, "    castedThis->m_" . $attribute->signature->name . ".set(exec->globalData(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
    17791865                    push(@implContent, "    return result;\n");
     1866
    17801867                } else {
    1781                     push(@implContent, "    ${className}* castedThis = jsCast<$className*>(asObject(slotBase));\n");
    1782 
    1783                     if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
    1784                         $needsMarkChildren = 1;
     1868                    my @arguments = ("ec");
     1869                    push(@implContent, "    ExceptionCode ec = 0;\n");
     1870
     1871                    unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()"));
     1872
     1873                    if ($svgPropertyOrListPropertyType) {
     1874                        push(@implContent, "    $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
     1875                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
     1876                    } else {
     1877                        push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
     1878                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
    17851879                    }
    17861880
    1787                     if ($dataNode->extendedAttributes->{"CheckSecurity"} &&
    1788                             !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} &&
    1789                             !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) {
    1790                         push(@implContent, "    if (!castedThis->allowsAccessFrom(exec))\n");
    1791                         push(@implContent, "        return jsUndefined();\n");
    1792                     }
    1793 
    1794                     if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) {
    1795                         push(@implContent, "    return castedThis->$implGetterFunctionName(exec);\n");
    1796                     } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
    1797                         $implIncludes{"JSDOMBinding.h"} = 1;
    1798                         push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
    1799                         push(@implContent, "    return shouldAllowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsNull();\n");
    1800                     } elsif ($type eq "EventListener") {
    1801                         $implIncludes{"EventListener.h"} = 1;
    1802                         push(@implContent, "    UNUSED_PARAM(exec);\n");
    1803                         push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
    1804                         push(@implContent, "    if (EventListener* listener = impl->$implGetterFunctionName()) {\n");
    1805                         push(@implContent, "        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n");
    1806                         if ($implClassName eq "Document" || $implClassName eq "WorkerContext" || $implClassName eq "SharedWorkerContext" || $implClassName eq "DedicatedWorkerContext") {
    1807                             push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl))\n");
    1808                         } else {
    1809                             push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl->scriptExecutionContext()))\n");
    1810                         }
    1811                         push(@implContent, "                return jsFunction;\n");
    1812                         push(@implContent, "        }\n");
    1813                         push(@implContent, "    }\n");
    1814                         push(@implContent, "    return jsNull();\n");
    1815                     } elsif ($attribute->signature->type =~ /Constructor$/) {
    1816                         my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
    1817                         $constructorType =~ s/Constructor$//;
    1818                         # Constructor attribute is only used by DOMWindow.idl, so it's correct to pass castedThis as the global object
    1819                         # Once JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
    1820                         push(@implContent, "    return JS" . $constructorType . "::getConstructor(exec, castedThis);\n");
    1821                     } elsif (!@{$attribute->getterExceptions}) {
    1822                         push(@implContent, "    UNUSED_PARAM(exec);\n") if !$attribute->signature->extendedAttributes->{"CallWith"};
    1823 
    1824                         my $cacheIndex = 0;
    1825                         if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
    1826                             $cacheIndex = $currentCachedAttribute;
    1827                             $currentCachedAttribute++;
    1828                             push(@implContent, "    if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
    1829                             push(@implContent, "        return cachedValue;\n");
    1830                         }
    1831 
    1832                         my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()");
    1833 
    1834                         if ($svgListPropertyType) {
    1835                             push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "castedThis->impl()->$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
    1836                         } elsif ($svgPropertyOrListPropertyType) {
    1837                             push(@implContent, "    $svgPropertyOrListPropertyType& impl = castedThis->impl()->propertyReference();\n");
    1838                             if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
    1839                                 push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl", "castedThis") . ";\n");
    1840                             } else {
    1841                                 push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
    1842 
    1843                             }
    1844                         } else {
    1845                             my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
    1846                             if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
    1847                                 my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
    1848                                 $implIncludes{"${implementedBy}.h"} = 1;
    1849                                 $functionName = "${implementedBy}::${functionName}";
    1850                                 unshift(@arguments, "impl");
    1851                             } else {
    1852                                 $functionName = "impl->${functionName}";
    1853                             }
    1854 
    1855                             unshift(@arguments, @callWithArgs);
    1856 
    1857                             my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
    1858                             push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
    1859                             if ($codeGenerator->IsSVGAnimatedType($type)) {
    1860                                 push(@implContent, "    RefPtr<$type> obj = $jsType;\n");
    1861                                 push(@implContent, "    JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());\n");
    1862                             } else {
    1863                                 push(@implContent, "    JSValue result = $jsType;\n");
    1864                             }
    1865                         }
    1866 
    1867                         push(@implContent, "    castedThis->m_" . $attribute->signature->name . ".set(exec->globalData(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
    1868                         push(@implContent, "    return result;\n");
    1869 
    1870                     } else {
    1871                         my @arguments = ("ec");
    1872                         push(@implContent, "    ExceptionCode ec = 0;\n");
    1873 
    1874                         unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()"));
    1875 
    1876                         if ($svgPropertyOrListPropertyType) {
    1877                             push(@implContent, "    $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
    1878                             push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
    1879                         } else {
    1880                             push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
    1881                             push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
    1882                         }
    1883 
    1884                         push(@implContent, "    setDOMException(exec, ec);\n");
    1885                         push(@implContent, "    return result;\n");
    1886                     }
     1881                    push(@implContent, "    setDOMException(exec, ec);\n");
     1882                    push(@implContent, "    return result;\n");
    18871883                }
    18881884
     
    19731969                        push(@implContent, "{\n");
    19741970
    1975                         if ($attribute->isStatic) {
    1976                             push(@implContent, "    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
    1977                             push(@implContent, "    if (!scriptContext)\n");
    1978                             push(@implContent, "        return;\n");
    1979                             my $nativeValue = JSValueToNative($attribute->signature, "value");
    1980                             push(@implContent, "    ${implClassName}::set$implSetterFunctionName(scriptContext, ${nativeValue});\n");
    1981                         } else {
    19821971                            push(@implContent, "    UNUSED_PARAM(exec);\n");
    19831972
     
    20282017                                push(@implContent, "    jsCast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n");
    20292018                            } else {
    2030                                 push(@implContent, "    $className* castedThis = jsCast<$className*>(thisObject);\n");
    2031                                 push(@implContent, "    $implType* impl = static_cast<$implType*>(castedThis->impl());\n");
     2019                                if (!$attribute->isStatic) {
     2020                                    push(@implContent, "    $className* castedThis = jsCast<$className*>(thisObject);\n");
     2021                                    push(@implContent, "    $implType* impl = static_cast<$implType*>(castedThis->impl());\n");
     2022                                }
    20322023                                push(@implContent, "    ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
    20332024
     
    20832074                                        unshift(@arguments, "impl");
    20842075                                        $functionName = "${implementedBy}::${functionName}";
     2076                                    } elsif ($attribute->isStatic) {
     2077                                        $functionName = "${implClassName}::${functionName}";
    20852078                                    } else {
    20862079                                        $functionName = "impl->${functionName}";
     
    20942087                                }
    20952088                            }
    2096                         }
    20972089
    20982090                        push(@implContent, "}\n\n");
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r123308 r123433  
    245245JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* exec, JSValue, PropertyName)
    246246{
    247     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    248     if (!scriptContext)
    249         return jsUndefined();
    250     JSC::JSValue result = jsNumber(TestInterface::supplementalStaticReadOnlyAttr(scriptContext));
     247    UNUSED_PARAM(exec);
     248    JSValue result = jsNumber(TestSupplemental::supplementalStaticReadOnlyAttr(impl));
    251249    return result;
    252250}
     
    257255JSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSValue, PropertyName)
    258256{
    259     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    260     if (!scriptContext)
    261         return jsUndefined();
    262     JSC::JSValue result = jsString(exec, TestInterface::supplementalStaticAttr(scriptContext));
     257    UNUSED_PARAM(exec);
     258    JSValue result = jsString(exec, TestSupplemental::supplementalStaticAttr(impl));
    263259    return result;
    264260}
     
    329325void setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObject*, JSValue value)
    330326{
    331     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    332     if (!scriptContext)
    333         return;
    334     TestInterface::setSupplementalStaticAttr(scriptContext, ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
     327    UNUSED_PARAM(exec);
     328    TestSupplemental::setSupplementalStaticAttr(impl, ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
    335329}
    336330
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r123047 r123433  
    417417JSValue jsTestObjConstructorStaticReadOnlyIntAttr(ExecState* exec, JSValue, PropertyName)
    418418{
    419     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    420     if (!scriptContext)
    421         return jsUndefined();
    422     JSC::JSValue result = jsNumber(TestObj::staticReadOnlyIntAttr(scriptContext));
     419    UNUSED_PARAM(exec);
     420    JSValue result = jsNumber(TestObj::staticReadOnlyIntAttr());
    423421    return result;
    424422}
     
    427425JSValue jsTestObjConstructorStaticStringAttr(ExecState* exec, JSValue, PropertyName)
    428426{
    429     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    430     if (!scriptContext)
    431         return jsUndefined();
    432     JSC::JSValue result = jsString(exec, TestObj::staticStringAttr(scriptContext));
     427    UNUSED_PARAM(exec);
     428    JSValue result = jsString(exec, TestObj::staticStringAttr());
    433429    return result;
    434430}
     
    950946void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject*, JSValue value)
    951947{
    952     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    953     if (!scriptContext)
    954         return;
    955     TestObj::setStaticStringAttr(scriptContext, ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
     948    UNUSED_PARAM(exec);
     949    TestObj::setStaticStringAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
    956950}
    957951
Note: See TracChangeset for help on using the changeset viewer.