javascriptcore bindings do not check exception after calling valueToStringWithNullCheck
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2013 00:41:19 +0000 (00:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2013 00:41:19 +0000 (00:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=113219

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-03-27
Reviewed by Kentaro Hara.

Source/WebCore:

When converting JSValue to native value in attribute setter, store the
native value in a temporary variable. After this variable assignment,
always check if an exception has been raised.

Update binding tests.

Test: fast/dom/exception-in-binding.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GetNativeType):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::setJSTestInterfaceSupplementalStr2):
(WebCore::setJSTestInterfaceSupplementalNode):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjConstructorStaticStringAttr):
(WebCore::setJSTestObjEnumAttr):
(WebCore::setJSTestObjShortAttr):
(WebCore::setJSTestObjUnsignedShortAttr):
(WebCore::setJSTestObjLongAttr):
(WebCore::setJSTestObjLongLongAttr):
(WebCore::setJSTestObjUnsignedLongLongAttr):
(WebCore::setJSTestObjStringAttr):
(WebCore::setJSTestObjTestObjAttr):
(WebCore::setJSTestObjXMLObjAttr):
(WebCore::setJSTestObjCreate):
(WebCore::setJSTestObjReflectedStringAttr):
(WebCore::setJSTestObjReflectedIntegralAttr):
(WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
(WebCore::setJSTestObjReflectedBooleanAttr):
(WebCore::setJSTestObjReflectedURLAttr):
(WebCore::setJSTestObjReflectedCustomIntegralAttr):
(WebCore::setJSTestObjReflectedCustomBooleanAttr):
(WebCore::setJSTestObjReflectedCustomURLAttr):
(WebCore::setJSTestObjTypedArrayAttr):
(WebCore::setJSTestObjAttrWithGetterException):
(WebCore::setJSTestObjAttrWithSetterException):
(WebCore::setJSTestObjStringAttrWithGetterException):
(WebCore::setJSTestObjStringAttrWithSetterException):
(WebCore::setJSTestObjWithScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::setJSTestObjConditionalAttr1):
(WebCore::setJSTestObjConditionalAttr2):
(WebCore::setJSTestObjConditionalAttr3):
(WebCore::setJSTestObjAnyAttribute):
(WebCore::setJSTestObjMutablePoint):
(WebCore::setJSTestObjImmutablePoint):
(WebCore::setJSTestObjStrawberry):
(WebCore::setJSTestObjStrictFloat):
(WebCore::setJSTestObjId):
(WebCore::setJSTestObjNullableLongSettableAttribute):
(WebCore::setJSTestObjNullableStringValue):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::setJSTestSerializedScriptValueInterfaceValue):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::setJSTestTypedefsUnsignedLongLongAttr):
(WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
(WebCore::setJSTestTypedefsAttrWithGetterException):
(WebCore::setJSTestTypedefsAttrWithSetterException):
(WebCore::setJSTestTypedefsStringAttrWithGetterException):
(WebCore::setJSTestTypedefsStringAttrWithSetterException):

LayoutTests:

* fast/dom/exception-in-binding-expected.txt: Added.
* fast/dom/exception-in-binding.html: Added.
* platform/chromium/TestExpectations: new test fails for now

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147038 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/exception-in-binding-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/exception-in-binding.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

index c8b9ddf..f274bf3 100644 (file)
@@ -1,3 +1,14 @@
+2013-03-27  Arnaud Renevier  <a.renevier@sisa.samsung.com>
+
+        javascriptcore bindings do not check exception after calling valueToStringWithNullCheck
+        https://bugs.webkit.org/show_bug.cgi?id=113219
+
+        Reviewed by Kentaro Hara.
+
+        * fast/dom/exception-in-binding-expected.txt: Added.
+        * fast/dom/exception-in-binding.html: Added.
+        * platform/chromium/TestExpectations: new test fails for now
+
 2013-03-27  Claudio Saavedra  <csaavedra@igalia.com>
 
         Explicitly set editingBehavior in some tests.
diff --git a/LayoutTests/fast/dom/exception-in-binding-expected.txt b/LayoutTests/fast/dom/exception-in-binding-expected.txt
new file mode 100644 (file)
index 0000000..a7f7fda
--- /dev/null
@@ -0,0 +1,9 @@
+Tests to ensure that attributes are not set when an exceptions is raised while converting argument to JSValue.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS select.name is "select"
+PASS select.selectedIndex is 1
+
+
diff --git a/LayoutTests/fast/dom/exception-in-binding.html b/LayoutTests/fast/dom/exception-in-binding.html
new file mode 100644 (file)
index 0000000..4be8bc8
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <script src="../js/resources/js-test-pre.js"></script>
+    <script>
+    description("Tests to ensure that attributes are not set when an exceptions is raised while converting argument to JSValue.");
+    function setName(select) {
+        var stringLike = {
+            toString: function() {
+                throw new Error("error");
+            }
+        };
+        select.name = stringLike;;
+    }
+
+    function setSelectedIndex(select) {
+        var integerLike = {
+            valueOf: function() {
+                throw new Error("error");
+            }
+        };
+        select.selectedIndex = integerLike;;
+    }
+
+    function runTest() {
+        var select = document.getElementById("select");
+        try {
+            setName(select);
+        } catch(e) {
+        }
+        shouldBe('select.name', '"select"');
+
+        try {
+            setSelectedIndex(select);
+        } catch(e) {
+        }
+        shouldBe('select.selectedIndex', '1');
+    }
+    </script>
+
+    </head>
+    <body onload="runTest()">
+    <select id="select" name="select">
+        <option value="value1">Value 1</option>
+        <option value="value2" selected>Value 2</option>
+        <option value="value3">Value 3</option>
+    </select>
+    <p id="description"></p>
+    <script src="../js/resources/js-test-pre.js"></script>
+</body>
+</html>
index 8b5eff7..0d624f4 100644 (file)
@@ -3798,3 +3798,5 @@ crbug.com/223329 [ MountainLion ] fast/writing-mode/text-orientation-basic.html
 crbug.com/223332 svg/css/root-shadow-offscreen.svg [ ImageOnlyFailure ]
 
 webkit.org/b/113114 media/video-controls-captions.html [ Timeout ]
+
+webkit.org/b/113219 fast/dom/exception-in-binding.html [ Failure ]
index 95cc37a..6c0cece 100644 (file)
@@ -1,5 +1,83 @@
 2013-03-27  Arnaud Renevier  <a.renevier@sisa.samsung.com>
 
+        javascriptcore bindings do not check exception after calling valueToStringWithNullCheck
+        https://bugs.webkit.org/show_bug.cgi?id=113219
+
+        Reviewed by Kentaro Hara.
+
+        When converting JSValue to native value in attribute setter, store the
+        native value in a temporary variable. After this variable assignment,
+        always check if an exception has been raised.
+
+        Update binding tests.
+
+        Test: fast/dom/exception-in-binding.html
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        (GetNativeType):
+        (JSValueToNative):
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
+        (WebCore::setJSTestInterfaceSupplementalStr2):
+        (WebCore::setJSTestInterfaceSupplementalNode):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::setJSTestObjConstructorStaticStringAttr):
+        (WebCore::setJSTestObjEnumAttr):
+        (WebCore::setJSTestObjShortAttr):
+        (WebCore::setJSTestObjUnsignedShortAttr):
+        (WebCore::setJSTestObjLongAttr):
+        (WebCore::setJSTestObjLongLongAttr):
+        (WebCore::setJSTestObjUnsignedLongLongAttr):
+        (WebCore::setJSTestObjStringAttr):
+        (WebCore::setJSTestObjTestObjAttr):
+        (WebCore::setJSTestObjXMLObjAttr):
+        (WebCore::setJSTestObjCreate):
+        (WebCore::setJSTestObjReflectedStringAttr):
+        (WebCore::setJSTestObjReflectedIntegralAttr):
+        (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
+        (WebCore::setJSTestObjReflectedBooleanAttr):
+        (WebCore::setJSTestObjReflectedURLAttr):
+        (WebCore::setJSTestObjReflectedCustomIntegralAttr):
+        (WebCore::setJSTestObjReflectedCustomBooleanAttr):
+        (WebCore::setJSTestObjReflectedCustomURLAttr):
+        (WebCore::setJSTestObjTypedArrayAttr):
+        (WebCore::setJSTestObjAttrWithGetterException):
+        (WebCore::setJSTestObjAttrWithSetterException):
+        (WebCore::setJSTestObjStringAttrWithGetterException):
+        (WebCore::setJSTestObjStringAttrWithSetterException):
+        (WebCore::setJSTestObjWithScriptStateAttribute):
+        (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
+        (WebCore::setJSTestObjWithScriptStateAttributeRaises):
+        (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
+        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
+        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
+        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
+        (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
+        (WebCore::setJSTestObjConditionalAttr1):
+        (WebCore::setJSTestObjConditionalAttr2):
+        (WebCore::setJSTestObjConditionalAttr3):
+        (WebCore::setJSTestObjAnyAttribute):
+        (WebCore::setJSTestObjMutablePoint):
+        (WebCore::setJSTestObjImmutablePoint):
+        (WebCore::setJSTestObjStrawberry):
+        (WebCore::setJSTestObjStrictFloat):
+        (WebCore::setJSTestObjId):
+        (WebCore::setJSTestObjNullableLongSettableAttribute):
+        (WebCore::setJSTestObjNullableStringValue):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::setJSTestSerializedScriptValueInterfaceValue):
+        (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
+        (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
+        (WebCore::setJSTestTypedefsAttrWithGetterException):
+        (WebCore::setJSTestTypedefsAttrWithSetterException):
+        (WebCore::setJSTestTypedefsStringAttrWithGetterException):
+        (WebCore::setJSTestTypedefsStringAttrWithSetterException):
+
+2013-03-27  Arnaud Renevier  <a.renevier@sisa.samsung.com>
+
         cache parsed interfaces in CodeGenerator.pm
         https://bugs.webkit.org/show_bug.cgi?id=113446
 
index cd1d700..2a0348f 100644 (file)
@@ -2142,21 +2142,18 @@ sub GenerateImplementation
                                     }
                                 }
 
-                                my $nativeValue;
+                                push(@implContent, "    " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue(" . JSValueToNative($attribute->signature, "value") . ");\n");
+                                push(@implContent, "    if (exec->hadException())\n");
+                                push(@implContent, "        return;\n");
+
                                 if ($codeGenerator->IsEnumType($type)) {
-                                    push(@implContent, "    const String string = value.isEmpty() ? String() : value.toString(exec)->value(exec);\n");
-                                    push(@implContent, "    if (exec->hadException())\n");
-                                    push(@implContent, "        return;\n");
                                     my @enumValues = $codeGenerator->ValidEnumValues($type);
                                     my @enumChecks = ();
                                     foreach my $enumValue (@enumValues) {
-                                        push(@enumChecks, "string != \"$enumValue\"");
+                                        push(@enumChecks, "nativeValue != \"$enumValue\"");
                                     }
                                     push (@implContent, "    if (" . join(" && ", @enumChecks) . ")\n");
                                     push (@implContent, "        return;\n");
-                                    $nativeValue = "string";
-                                } else {
-                                    $nativeValue = JSValueToNative($attribute->signature, "value");
                                 }
 
                                 if ($svgPropertyOrListPropertyType) {
@@ -2169,9 +2166,9 @@ sub GenerateImplementation
                                     }
                                     push(@implContent, "    $svgPropertyOrListPropertyType& podImpl = impl->propertyReference();\n");
                                     if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
-                                        push(@implContent, "    podImpl = $nativeValue;\n");
+                                        push(@implContent, "    podImpl = nativeValue;\n");
                                     } else {
-                                        push(@implContent, "    podImpl.set$implSetterFunctionName($nativeValue");
+                                        push(@implContent, "    podImpl.set$implSetterFunctionName(nativeValue");
                                         push(@implContent, ", ec") if @{$attribute->setterExceptions};
                                         push(@implContent, ");\n");
                                         push(@implContent, "    setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
@@ -2186,7 +2183,7 @@ sub GenerateImplementation
                                     }
                                 } else {
                                     my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
-                                    push(@arguments, $nativeValue);
+                                    push(@arguments, "nativeValue");
                                     if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
                                         my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
                                         $implIncludes{"${implementedBy}.h"} = 1;
@@ -3097,6 +3094,7 @@ my %nativeType = (
     "DOMString" => "const String&",
     "NodeFilter" => "RefPtr<NodeFilter>",
     "SerializedScriptValue" => "RefPtr<SerializedScriptValue>",
+    "Date" => "double",
     "Dictionary" => "Dictionary",
     "any" => "ScriptValue",
     "boolean" => "bool",
@@ -3127,6 +3125,10 @@ sub GetNativeType
 
     return "Vector<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">" if $arrayOrSequenceType;
 
+    if ($codeGenerator->IsEnumType($type)) {
+        return "const String";
+    }
+
     # For all other types, the native type is a pointer with same type name as the IDL type.
     return "${type}*";
 }
@@ -3273,6 +3275,10 @@ sub JSValueToNative
         return "toNativeArray<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">(exec, $value)";
     }
 
+    if ($codeGenerator->IsEnumType($type)) {
+        return "$value.isEmpty() ? String() : $value.toString(exec)->value(exec)";
+    }
+
     # Default, assume autogenerated type conversion routines
     AddToImplIncludes("JS$type.h", $conditional);
     return "to$type($value)";
index 34365c4..0f0cd54 100644 (file)
@@ -339,7 +339,10 @@ void JSTestInterface::putByIndex(JSCell* cell, ExecState* exec, unsigned index,
 void setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObject*, JSValue value)
 {
     UNUSED_PARAM(exec);
-    TestSupplemental::setSupplementalStaticAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    TestSupplemental::setSupplementalStaticAttr(nativeValue);
 }
 
 #endif
@@ -350,7 +353,10 @@ void setJSTestInterfaceSupplementalStr2(ExecState* exec, JSObject* thisObject, J
     UNUSED_PARAM(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
     TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
-    TestSupplemental::setSupplementalStr2(impl, value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    TestSupplemental::setSupplementalStr2(impl, nativeValue);
 }
 
 #endif
@@ -370,7 +376,10 @@ void setJSTestInterfaceSupplementalNode(ExecState* exec, JSObject* thisObject, J
     UNUSED_PARAM(exec);
     JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
     TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
-    TestSupplemental::setSupplementalNode(impl, toNode(value));
+    Node* nativeValue(toNode(value));
+    if (exec->hadException())
+        return;
+    TestSupplemental::setSupplementalNode(impl, nativeValue);
 }
 
 #endif
index a03397e..261fbbd 100644 (file)
@@ -1076,7 +1076,10 @@ void JSTestObj::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JS
 void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject*, JSValue value)
 {
     UNUSED_PARAM(exec);
-    TestObj::setStaticStringAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    TestObj::setStaticStringAttr(nativeValue);
 }
 
 
@@ -1085,12 +1088,12 @@ void setJSTestObjEnumAttr(ExecState* exec, JSObject* thisObject, JSValue value)
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    const String string = value.isEmpty() ? String() : value.toString(exec)->value(exec);
+    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
     if (exec->hadException())
         return;
-    if (string != "" && string != "EnumValue1" && string != "EnumValue2" && string != "EnumValue3")
+    if (nativeValue != "" && nativeValue != "EnumValue1" && nativeValue != "EnumValue2" && nativeValue != "EnumValue3")
         return;
-    impl->setEnumAttr(string);
+    impl->setEnumAttr(nativeValue);
 }
 
 
@@ -1099,7 +1102,10 @@ void setJSTestObjShortAttr(ExecState* exec, JSObject* thisObject, JSValue value)
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setShortAttr(toInt32(exec, value, NormalConversion));
+    short nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setShortAttr(nativeValue);
 }
 
 
@@ -1108,7 +1114,10 @@ void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* thisObject, JSValu
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setUnsignedShortAttr(toUInt32(exec, value, NormalConversion));
+    unsigned short nativeValue(toUInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setUnsignedShortAttr(nativeValue);
 }
 
 
@@ -1117,7 +1126,10 @@ void setJSTestObjLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setLongAttr(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setLongAttr(nativeValue);
 }
 
 
@@ -1126,7 +1138,10 @@ void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue val
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setLongLongAttr(toInt64(exec, value, NormalConversion));
+    long long nativeValue(toInt64(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setLongLongAttr(nativeValue);
 }
 
 
@@ -1135,7 +1150,10 @@ void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSV
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setUnsignedLongLongAttr(toUInt64(exec, value, NormalConversion));
+    unsigned long long nativeValue(toUInt64(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setUnsignedLongLongAttr(nativeValue);
 }
 
 
@@ -1144,7 +1162,10 @@ void setJSTestObjStringAttr(ExecState* exec, JSObject* thisObject, JSValue value
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setStringAttr(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    impl->setStringAttr(nativeValue);
 }
 
 
@@ -1153,7 +1174,10 @@ void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue valu
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setTestObjAttr(toTestObj(value));
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
+    impl->setTestObjAttr(nativeValue);
 }
 
 
@@ -1162,7 +1186,10 @@ void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* thisObject, JSValue value
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setXMLObjAttr(toTestObj(value));
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
+    impl->setXMLObjAttr(nativeValue);
 }
 
 
@@ -1171,7 +1198,10 @@ void setJSTestObjCreate(ExecState* exec, JSObject* thisObject, JSValue value)
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setCreate(value.toBoolean(exec));
+    bool nativeValue(value.toBoolean(exec));
+    if (exec->hadException())
+        return;
+    impl->setCreate(nativeValue);
 }
 
 
@@ -1180,7 +1210,10 @@ void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSVa
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value));
+    const String& nativeValue(valueToStringWithNullCheck(exec, value));
+    if (exec->hadException())
+        return;
+    impl->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, nativeValue);
 }
 
 
@@ -1189,7 +1222,10 @@ void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JS
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, nativeValue);
 }
 
 
@@ -1198,7 +1234,10 @@ void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* thisOb
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, toUInt32(exec, value, NormalConversion));
+    unsigned nativeValue(toUInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, nativeValue);
 }
 
 
@@ -1207,7 +1246,10 @@ void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSV
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec));
+    bool nativeValue(value.toBoolean(exec));
+    if (exec->hadException())
+        return;
+    impl->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, nativeValue);
 }
 
 
@@ -1216,7 +1258,10 @@ void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value));
+    const String& nativeValue(valueToStringWithNullCheck(exec, value));
+    if (exec->hadException())
+        return;
+    impl->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, nativeValue);
 }
 
 
@@ -1225,7 +1270,10 @@ void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSVa
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value));
+    const String& nativeValue(valueToStringWithNullCheck(exec, value));
+    if (exec->hadException())
+        return;
+    impl->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, nativeValue);
 }
 
 
@@ -1234,7 +1282,10 @@ void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObje
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, nativeValue);
 }
 
 
@@ -1243,7 +1294,10 @@ void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObjec
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec));
+    bool nativeValue(value.toBoolean(exec));
+    if (exec->hadException())
+        return;
+    impl->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, nativeValue);
 }
 
 
@@ -1252,7 +1306,10 @@ void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* thisObject, J
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value));
+    const String& nativeValue(valueToStringWithNullCheck(exec, value));
+    if (exec->hadException())
+        return;
+    impl->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, nativeValue);
 }
 
 
@@ -1261,7 +1318,10 @@ void setJSTestObjTypedArrayAttr(ExecState* exec, JSObject* thisObject, JSValue v
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setTypedArrayAttr(toFloat32Array(value));
+    Float32Array* nativeValue(toFloat32Array(value));
+    if (exec->hadException())
+        return;
+    impl->setTypedArrayAttr(nativeValue);
 }
 
 
@@ -1270,7 +1330,10 @@ void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject,
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setAttrWithGetterException(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setAttrWithGetterException(nativeValue);
 }
 
 
@@ -1280,7 +1343,10 @@ void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject,
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
     ExceptionCode ec = 0;
-    impl->setAttrWithSetterException(toInt32(exec, value, NormalConversion), ec);
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setAttrWithSetterException(nativeValue, ec);
     setDOMException(exec, ec);
 }
 
@@ -1290,7 +1356,10 @@ void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisOb
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setStringAttrWithGetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    impl->setStringAttrWithGetterException(nativeValue);
 }
 
 
@@ -1300,7 +1369,10 @@ void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisOb
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
     ExceptionCode ec = 0;
-    impl->setStringAttrWithSetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec), ec);
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    impl->setStringAttrWithSetterException(nativeValue, ec);
     setDOMException(exec, ec);
 }
 
@@ -1317,7 +1389,10 @@ void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* thisObject,
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setWithScriptStateAttribute(exec, toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setWithScriptStateAttribute(exec, nativeValue);
 }
 
 
@@ -1326,10 +1401,13 @@ void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject*
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return;
-    impl->setWithScriptExecutionContextAttribute(scriptContext, toTestObj(value));
+    impl->setWithScriptExecutionContextAttribute(scriptContext, nativeValue);
 }
 
 
@@ -1338,7 +1416,10 @@ void setJSTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* thisO
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setWithScriptStateAttributeRaises(exec, toTestObj(value));
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
+    impl->setWithScriptStateAttributeRaises(exec, nativeValue);
 }
 
 
@@ -1347,10 +1428,13 @@ void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSOb
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return;
-    impl->setWithScriptExecutionContextAttributeRaises(scriptContext, toTestObj(value));
+    impl->setWithScriptExecutionContextAttributeRaises(scriptContext, nativeValue);
 }
 
 
@@ -1359,10 +1443,13 @@ void setJSTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* ex
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return;
-    impl->setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, toTestObj(value));
+    impl->setWithScriptExecutionContextAndScriptStateAttribute(exec, scriptContext, nativeValue);
 }
 
 
@@ -1371,10 +1458,13 @@ void setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecSta
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return;
-    impl->setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, toTestObj(value));
+    impl->setWithScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, nativeValue);
 }
 
 
@@ -1383,10 +1473,13 @@ void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(Exe
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
     ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return;
-    impl->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, toTestObj(value));
+    impl->setWithScriptExecutionContextAndScriptStateWithSpacesAttribute(exec, scriptContext, nativeValue);
 }
 
 
@@ -1395,7 +1488,10 @@ void setJSTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObj
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setWithScriptArgumentsAndCallStackAttribute(toTestObj(value));
+    TestObj* nativeValue(toTestObj(value));
+    if (exec->hadException())
+        return;
+    impl->setWithScriptArgumentsAndCallStackAttribute(nativeValue);
 }
 
 
@@ -1405,7 +1501,10 @@ void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setConditionalAttr1(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setConditionalAttr1(nativeValue);
 }
 
 #endif
@@ -1416,7 +1515,10 @@ void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setConditionalAttr2(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setConditionalAttr2(nativeValue);
 }
 
 #endif
@@ -1427,7 +1529,10 @@ void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setConditionalAttr3(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setConditionalAttr3(nativeValue);
 }
 
 #endif
@@ -1467,7 +1572,10 @@ void setJSTestObjAnyAttribute(ExecState* exec, JSObject* thisObject, JSValue val
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setAnyAttribute(exec->globalData(), value);
+    ScriptValue nativeValue(exec->globalData(), value);
+    if (exec->hadException())
+        return;
+    impl->setAnyAttribute(nativeValue);
 }
 
 
@@ -1476,7 +1584,10 @@ void setJSTestObjMutablePoint(ExecState* exec, JSObject* thisObject, JSValue val
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setMutablePoint(toSVGPoint(value));
+    SVGPropertyTearOff<FloatPoint>* nativeValue(toSVGPoint(value));
+    if (exec->hadException())
+        return;
+    impl->setMutablePoint(nativeValue);
 }
 
 
@@ -1485,7 +1596,10 @@ void setJSTestObjImmutablePoint(ExecState* exec, JSObject* thisObject, JSValue v
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setImmutablePoint(toSVGPoint(value));
+    SVGPropertyTearOff<FloatPoint>* nativeValue(toSVGPoint(value));
+    if (exec->hadException())
+        return;
+    impl->setImmutablePoint(nativeValue);
 }
 
 
@@ -1494,7 +1608,10 @@ void setJSTestObjStrawberry(ExecState* exec, JSObject* thisObject, JSValue value
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setBlueberry(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setBlueberry(nativeValue);
 }
 
 
@@ -1503,7 +1620,10 @@ void setJSTestObjStrictFloat(ExecState* exec, JSObject* thisObject, JSValue valu
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setStrictFloat(value.toFloat(exec));
+    float nativeValue(value.toFloat(exec));
+    if (exec->hadException())
+        return;
+    impl->setStrictFloat(nativeValue);
 }
 
 
@@ -1512,7 +1632,10 @@ void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setId(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setId(nativeValue);
 }
 
 
@@ -1529,7 +1652,10 @@ void setJSTestObjNullableLongSettableAttribute(ExecState* exec, JSObject* thisOb
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setNullableLongSettableAttribute(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setNullableLongSettableAttribute(nativeValue);
 }
 
 
@@ -1538,7 +1664,10 @@ void setJSTestObjNullableStringValue(ExecState* exec, JSObject* thisObject, JSVa
     UNUSED_PARAM(exec);
     JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    impl->setNullableStringValue(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setNullableStringValue(nativeValue);
 }
 
 
index e16ef34..e857a3d 100644 (file)
@@ -257,7 +257,10 @@ void setJSTestSerializedScriptValueInterfaceValue(ExecState* exec, JSObject* thi
     UNUSED_PARAM(exec);
     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
-    impl->setValue(SerializedScriptValue::create(exec, value, 0, 0));
+    RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0));
+    if (exec->hadException())
+        return;
+    impl->setValue(nativeValue);
 }
 
 
@@ -266,7 +269,10 @@ void setJSTestSerializedScriptValueInterfaceCachedValue(ExecState* exec, JSObjec
     UNUSED_PARAM(exec);
     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject);
     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
-    impl->setCachedValue(SerializedScriptValue::create(exec, value, 0, 0));
+    RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0));
+    if (exec->hadException())
+        return;
+    impl->setCachedValue(nativeValue);
 }
 
 
index a021b28..512bd3a 100644 (file)
@@ -280,7 +280,10 @@ void setJSTestTypedefsUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject
     UNUSED_PARAM(exec);
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject);
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
-    impl->setUnsignedLongLongAttr(toUInt64(exec, value, NormalConversion));
+    unsigned long long nativeValue(toUInt64(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setUnsignedLongLongAttr(nativeValue);
 }
 
 
@@ -289,7 +292,10 @@ void setJSTestTypedefsImmutableSerializedScriptValue(ExecState* exec, JSObject*
     UNUSED_PARAM(exec);
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject);
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
-    impl->setImmutableSerializedScriptValue(SerializedScriptValue::create(exec, value, 0, 0));
+    RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0));
+    if (exec->hadException())
+        return;
+    impl->setImmutableSerializedScriptValue(nativeValue);
 }
 
 
@@ -298,7 +304,10 @@ void setJSTestTypedefsAttrWithGetterException(ExecState* exec, JSObject* thisObj
     UNUSED_PARAM(exec);
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject);
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
-    impl->setAttrWithGetterException(toInt32(exec, value, NormalConversion));
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setAttrWithGetterException(nativeValue);
 }
 
 
@@ -308,7 +317,10 @@ void setJSTestTypedefsAttrWithSetterException(ExecState* exec, JSObject* thisObj
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject);
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
     ExceptionCode ec = 0;
-    impl->setAttrWithSetterException(toInt32(exec, value, NormalConversion), ec);
+    int nativeValue(toInt32(exec, value, NormalConversion));
+    if (exec->hadException())
+        return;
+    impl->setAttrWithSetterException(nativeValue, ec);
     setDOMException(exec, ec);
 }
 
@@ -318,7 +330,10 @@ void setJSTestTypedefsStringAttrWithGetterException(ExecState* exec, JSObject* t
     UNUSED_PARAM(exec);
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject);
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
-    impl->setStringAttrWithGetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    impl->setStringAttrWithGetterException(nativeValue);
 }
 
 
@@ -328,7 +343,10 @@ void setJSTestTypedefsStringAttrWithSetterException(ExecState* exec, JSObject* t
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(thisObject);
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
     ExceptionCode ec = 0;
-    impl->setStringAttrWithSetterException(value.isEmpty() ? String() : value.toString(exec)->value(exec), ec);
+    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    if (exec->hadException())
+        return;
+    impl->setStringAttrWithSetterException(nativeValue, ec);
     setDOMException(exec, ec);
 }