Title: [123433] trunk/Source/WebCore
Revision
123433
Author
hara...@chromium.org
Date
2012-07-24 00:21:25 -0700 (Tue, 24 Jul 2012)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123432 => 123433)


--- trunk/Source/WebCore/ChangeLog	2012-07-24 07:11:31 UTC (rev 123432)
+++ trunk/Source/WebCore/ChangeLog	2012-07-24 07:21:25 UTC (rev 123433)
@@ -1,3 +1,34 @@
+2012-07-24  Kentaro Hara  <hara...@chromium.org>
+
+        [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):
+
 2012-07-23  Gyuyoung Kim  <gyuyoung....@samsung.com>
 
         Missing *explicit* keyword in editing.

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (123432 => 123433)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-07-24 07:11:31 UTC (rev 123432)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-07-24 07:21:25 UTC (rev 123433)
@@ -1771,119 +1771,115 @@
                 push(@implContent, ", PropertyName)\n");
                 push(@implContent, "{\n");
 
-                if ($attribute->isStatic) {
-                    push(@implContent, "    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
-                    push(@implContent, "    if (!scriptContext)\n");
-                    push(@implContent, "        return jsUndefined();\n");
-                    push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "${implClassName}::$implGetterFunctionName(scriptContext)", "") . ";\n");
-                    push(@implContent, "    return result;\n");
-                } else {
+                if (!$attribute->isStatic) {
                     push(@implContent, "    ${className}* castedThis = jsCast<$className*>(asObject(slotBase));\n");
+                }
 
-                    if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
-                        $needsMarkChildren = 1;
+                if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
+                    $needsMarkChildren = 1;
+                }
+
+                if ($dataNode->extendedAttributes->{"CheckSecurity"} &&
+                    !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} &&
+                    !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) {
+                    push(@implContent, "    if (!castedThis->allowsAccessFrom(exec))\n");
+                    push(@implContent, "        return jsUndefined();\n");
+                }
+
+                if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) {
+                    push(@implContent, "    return castedThis->$implGetterFunctionName(exec);\n");
+                } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
+                    $implIncludes{"JSDOMBinding.h"} = 1;
+                    push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
+                    push(@implContent, "    return shouldAllowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsNull();\n");
+                } elsif ($type eq "EventListener") {
+                    $implIncludes{"EventListener.h"} = 1;
+                    push(@implContent, "    UNUSED_PARAM(exec);\n");
+                    push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
+                    push(@implContent, "    if (EventListener* listener = impl->$implGetterFunctionName()) {\n");
+                    push(@implContent, "        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n");
+                    if ($implClassName eq "Document" || $implClassName eq "WorkerContext" || $implClassName eq "SharedWorkerContext" || $implClassName eq "DedicatedWorkerContext") {
+                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl))\n");
+                    } else {
+                        push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl->scriptExecutionContext()))\n");
                     }
+                    push(@implContent, "                return jsFunction;\n");
+                    push(@implContent, "        }\n");
+                    push(@implContent, "    }\n");
+                    push(@implContent, "    return jsNull();\n");
+                } elsif ($attribute->signature->type =~ /Constructor$/) {
+                    my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
+                    $constructorType =~ s/Constructor$//;
+                    # Constructor attribute is only used by DOMWindow.idl, so it's correct to pass castedThis as the global object
+                    # Once JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
+                    push(@implContent, "    return JS" . $constructorType . "::getConstructor(exec, castedThis);\n");
+                } elsif (!@{$attribute->getterExceptions}) {
+                    push(@implContent, "    UNUSED_PARAM(exec);\n") if !$attribute->signature->extendedAttributes->{"CallWith"};
 
-                    if ($dataNode->extendedAttributes->{"CheckSecurity"} &&
-                            !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} &&
-                            !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) {
-                        push(@implContent, "    if (!castedThis->allowsAccessFrom(exec))\n");
-                        push(@implContent, "        return jsUndefined();\n");
+                    my $cacheIndex = 0;
+                    if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
+                        $cacheIndex = $currentCachedAttribute;
+                        $currentCachedAttribute++;
+                        push(@implContent, "    if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
+                        push(@implContent, "        return cachedValue;\n");
                     }
 
-                    if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) {
-                        push(@implContent, "    return castedThis->$implGetterFunctionName(exec);\n");
-                    } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
-                        $implIncludes{"JSDOMBinding.h"} = 1;
-                        push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
-                        push(@implContent, "    return shouldAllowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsNull();\n");
-                    } elsif ($type eq "EventListener") {
-                        $implIncludes{"EventListener.h"} = 1;
-                        push(@implContent, "    UNUSED_PARAM(exec);\n");
-                        push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
-                        push(@implContent, "    if (EventListener* listener = impl->$implGetterFunctionName()) {\n");
-                        push(@implContent, "        if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n");
-                        if ($implClassName eq "Document" || $implClassName eq "WorkerContext" || $implClassName eq "SharedWorkerContext" || $implClassName eq "DedicatedWorkerContext") {
-                            push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl))\n");
+                    my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()");
+
+                    if ($svgListPropertyType) {
+                        push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "castedThis->impl()->$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
+                    } elsif ($svgPropertyOrListPropertyType) {
+                        push(@implContent, "    $svgPropertyOrListPropertyType& impl = castedThis->impl()->propertyReference();\n");
+                        if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
+                            push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl", "castedThis") . ";\n");
                         } else {
-                            push(@implContent, "            if (JSObject* jsFunction = jsListener->jsFunction(impl->scriptExecutionContext()))\n");
-                        }
-                        push(@implContent, "                return jsFunction;\n");
-                        push(@implContent, "        }\n");
-                        push(@implContent, "    }\n");
-                        push(@implContent, "    return jsNull();\n");
-                    } elsif ($attribute->signature->type =~ /Constructor$/) {
-                        my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
-                        $constructorType =~ s/Constructor$//;
-                        # Constructor attribute is only used by DOMWindow.idl, so it's correct to pass castedThis as the global object
-                        # Once JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
-                        push(@implContent, "    return JS" . $constructorType . "::getConstructor(exec, castedThis);\n");
-                    } elsif (!@{$attribute->getterExceptions}) {
-                        push(@implContent, "    UNUSED_PARAM(exec);\n") if !$attribute->signature->extendedAttributes->{"CallWith"};
+                            push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
 
-                        my $cacheIndex = 0;
-                        if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
-                            $cacheIndex = $currentCachedAttribute;
-                            $currentCachedAttribute++;
-                            push(@implContent, "    if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
-                            push(@implContent, "        return cachedValue;\n");
                         }
-
-                        my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()");
-
-                        if ($svgListPropertyType) {
-                            push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "castedThis->impl()->$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
-                        } elsif ($svgPropertyOrListPropertyType) {
-                            push(@implContent, "    $svgPropertyOrListPropertyType& impl = castedThis->impl()->propertyReference();\n");
-                            if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
-                                push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl", "castedThis") . ";\n");
-                            } else {
-                                push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
-
-                            }
+                    } else {
+                        my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
+                        if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
+                            my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
+                            $implIncludes{"${implementedBy}.h"} = 1;
+                            $functionName = "${implementedBy}::${functionName}";
+                            unshift(@arguments, "impl");
+                        } elsif ($attribute->isStatic) {
+                            $functionName = "${implClassName}::${functionName}";
                         } else {
-                            my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
-                            if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
-                                my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
-                                $implIncludes{"${implementedBy}.h"} = 1;
-                                $functionName = "${implementedBy}::${functionName}";
-                                unshift(@arguments, "impl");
-                            } else {
-                                $functionName = "impl->${functionName}";
-                            }
+                            $functionName = "impl->${functionName}";
+                        }
 
-                            unshift(@arguments, @callWithArgs);
+                        unshift(@arguments, @callWithArgs);
 
-                            my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
-                            push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
-                            if ($codeGenerator->IsSVGAnimatedType($type)) {
-                                push(@implContent, "    RefPtr<$type> obj = $jsType;\n");
-                                push(@implContent, "    JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());\n");
-                            } else {
-                                push(@implContent, "    JSValue result = $jsType;\n");
-                            }
+                        my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
+                        push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n") if !$attribute->isStatic;
+                        if ($codeGenerator->IsSVGAnimatedType($type)) {
+                            push(@implContent, "    RefPtr<$type> obj = $jsType;\n");
+                            push(@implContent, "    JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());\n");
+                        } else {
+                            push(@implContent, "    JSValue result = $jsType;\n");
                         }
+                    }
 
-                        push(@implContent, "    castedThis->m_" . $attribute->signature->name . ".set(exec->globalData(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
-                        push(@implContent, "    return result;\n");
+                    push(@implContent, "    castedThis->m_" . $attribute->signature->name . ".set(exec->globalData(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
+                    push(@implContent, "    return result;\n");
 
-                    } else {
-                        my @arguments = ("ec");
-                        push(@implContent, "    ExceptionCode ec = 0;\n");
+                } else {
+                    my @arguments = ("ec");
+                    push(@implContent, "    ExceptionCode ec = 0;\n");
 
-                        unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()"));
+                    unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()"));
 
-                        if ($svgPropertyOrListPropertyType) {
-                            push(@implContent, "    $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
-                            push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
-                        } else {
-                            push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
-                            push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
-                        }
-
-                        push(@implContent, "    setDOMException(exec, ec);\n");
-                        push(@implContent, "    return result;\n");
+                    if ($svgPropertyOrListPropertyType) {
+                        push(@implContent, "    $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
+                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
+                    } else {
+                        push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
+                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
                     }
+
+                    push(@implContent, "    setDOMException(exec, ec);\n");
+                    push(@implContent, "    return result;\n");
                 }
 
                 push(@implContent, "}\n\n");
@@ -1972,13 +1968,6 @@
                         push(@implContent, ", JSValue value)\n");
                         push(@implContent, "{\n");
 
-                        if ($attribute->isStatic) {
-                            push(@implContent, "    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
-                            push(@implContent, "    if (!scriptContext)\n");
-                            push(@implContent, "        return;\n");
-                            my $nativeValue = JSValueToNative($attribute->signature, "value");
-                            push(@implContent, "    ${implClassName}::set$implSetterFunctionName(scriptContext, ${nativeValue});\n");
-                        } else {
                             push(@implContent, "    UNUSED_PARAM(exec);\n");
 
                             if ($dataNode->extendedAttributes->{"CheckSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
@@ -2027,8 +2016,10 @@
                                 push(@implContent, "    // Shadowing a built-in object\n");
                                 push(@implContent, "    jsCast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n");
                             } else {
-                                push(@implContent, "    $className* castedThis = jsCast<$className*>(thisObject);\n");
-                                push(@implContent, "    $implType* impl = static_cast<$implType*>(castedThis->impl());\n");
+                                if (!$attribute->isStatic) {
+                                    push(@implContent, "    $className* castedThis = jsCast<$className*>(thisObject);\n");
+                                    push(@implContent, "    $implType* impl = static_cast<$implType*>(castedThis->impl());\n");
+                                }
                                 push(@implContent, "    ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
 
                                 # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an
@@ -2082,6 +2073,8 @@
                                         $implIncludes{"${implementedBy}.h"} = 1;
                                         unshift(@arguments, "impl");
                                         $functionName = "${implementedBy}::${functionName}";
+                                    } elsif ($attribute->isStatic) {
+                                        $functionName = "${implClassName}::${functionName}";
                                     } else {
                                         $functionName = "impl->${functionName}";
                                     }
@@ -2093,7 +2086,6 @@
                                     push(@implContent, "    setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
                                 }
                             }
-                        }
 
                         push(@implContent, "}\n\n");
                         push(@implContent, "#endif\n") if $attributeConditionalString;

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (123432 => 123433)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2012-07-24 07:11:31 UTC (rev 123432)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2012-07-24 07:21:25 UTC (rev 123433)
@@ -244,10 +244,8 @@
 #if ENABLE(Condition11) || ENABLE(Condition12)
 JSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* exec, JSValue, PropertyName)
 {
-    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
-    if (!scriptContext)
-        return jsUndefined();
-    JSC::JSValue result = jsNumber(TestInterface::supplementalStaticReadOnlyAttr(scriptContext));
+    UNUSED_PARAM(exec);
+    JSValue result = jsNumber(TestSupplemental::supplementalStaticReadOnlyAttr(impl));
     return result;
 }
 
@@ -256,10 +254,8 @@
 #if ENABLE(Condition11) || ENABLE(Condition12)
 JSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSValue, PropertyName)
 {
-    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
-    if (!scriptContext)
-        return jsUndefined();
-    JSC::JSValue result = jsString(exec, TestInterface::supplementalStaticAttr(scriptContext));
+    UNUSED_PARAM(exec);
+    JSValue result = jsString(exec, TestSupplemental::supplementalStaticAttr(impl));
     return result;
 }
 
@@ -328,10 +324,8 @@
 #if ENABLE(Condition11) || ENABLE(Condition12)
 void setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObject*, JSValue value)
 {
-    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
-    if (!scriptContext)
-        return;
-    TestInterface::setSupplementalStaticAttr(scriptContext, ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
+    UNUSED_PARAM(exec);
+    TestSupplemental::setSupplementalStaticAttr(impl, ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
 }
 
 #endif

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (123432 => 123433)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2012-07-24 07:11:31 UTC (rev 123432)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2012-07-24 07:21:25 UTC (rev 123433)
@@ -416,20 +416,16 @@
 
 JSValue jsTestObjConstructorStaticReadOnlyIntAttr(ExecState* exec, JSValue, PropertyName)
 {
-    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
-    if (!scriptContext)
-        return jsUndefined();
-    JSC::JSValue result = jsNumber(TestObj::staticReadOnlyIntAttr(scriptContext));
+    UNUSED_PARAM(exec);
+    JSValue result = jsNumber(TestObj::staticReadOnlyIntAttr());
     return result;
 }
 
 
 JSValue jsTestObjConstructorStaticStringAttr(ExecState* exec, JSValue, PropertyName)
 {
-    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
-    if (!scriptContext)
-        return jsUndefined();
-    JSC::JSValue result = jsString(exec, TestObj::staticStringAttr(scriptContext));
+    UNUSED_PARAM(exec);
+    JSValue result = jsString(exec, TestObj::staticStringAttr());
     return result;
 }
 
@@ -949,10 +945,8 @@
 
 void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject*, JSValue value)
 {
-    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
-    if (!scriptContext)
-        return;
-    TestObj::setStaticStringAttr(scriptContext, ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
+    UNUSED_PARAM(exec);
+    TestObj::setStaticStringAttr(ustringToString(value.isEmpty() ? UString() : value.toString(exec)->value(exec)));
 }
 
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to