JavaScript bindings are unnecessarily checking for impossible empty JSValue arguments
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jun 2015 19:55:02 +0000 (19:55 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jun 2015 19:55:02 +0000 (19:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145811

Reviewed by Antti Koivisto.

At some point, someone who didn't understand JSValue very well added checks for
isEmpty (and the function isEmpty itself) in JavaScript bindings. But the engine
never would pass an empty JSValue to a binding; that's used only inside the
engine itself. I think this was done by some Google V8 experts a while back, so
it's not entirely surprising they didn't understand this. But we don't want to
keep all that unneeded code.

* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind): Removed the isEmpty clause here. I presume this
was copied and pasted from script-generated bindings. While I was at it, I used a
slightly more efficient code path that avoids doing a ref/deref on the string by
using auto&. That's trickier to do correctly for functions with more than one
argument, so I didn't do it in the bindings generator yet.
(WebCore::JSAudioTrack::setLanguage): Ditto.
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setKind): Ditto.
(WebCore::JSTextTrack::setLanguage): Ditto.
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind): Ditto.
(WebCore::JSVideoTrack::setLanguage): Ditto.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Use "=" syntax instead of constructor style syntax for
the argument processing. I think this is more readable.
(GenerateParametersCheck): For the enum code path, did the more efficient auto&
idiom to avoid ref/deref on a string. For the toExistingAtomicString path,
restructured so we don't have to check the flag indicating that something is atomic.
Later we could also avoid the ref/deref; added a FIXME about that.
(GetNativeType): Use String, not const String, for local variables. Sure, the
string is const, but so is every other local variable type we use! No need to be
wordy about it.
(JSValueToNative): Removed the uneeded calls to isEmpty. Since the call sites no
longer use construction syntax, used initializer syntax style for a couple classes
that are constructed with multiple arguments.

* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Updated.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
* bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
* bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Ditto.
* bindings/scripts/test/JS/JSTestNondeterministic.cpp: Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
* bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.

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

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSAudioTrackCustom.cpp
Source/WebCore/bindings/js/JSTextTrackCustom.cpp
Source/WebCore/bindings/js/JSVideoTrackCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

index 081732414e63144b619728e15304b40967365bf6..6db4be2c0ce9be72245891e453ab7ceafad36a48 100644 (file)
@@ -1,3 +1,56 @@
+2015-06-09  Darin Adler  <darin@apple.com>
+
+        JavaScript bindings are unnecessarily checking for impossible empty JSValue arguments
+        https://bugs.webkit.org/show_bug.cgi?id=145811
+
+        Reviewed by Antti Koivisto.
+
+        At some point, someone who didn't understand JSValue very well added checks for
+        isEmpty (and the function isEmpty itself) in JavaScript bindings. But the engine
+        never would pass an empty JSValue to a binding; that's used only inside the
+        engine itself. I think this was done by some Google V8 experts a while back, so
+        it's not entirely surprising they didn't understand this. But we don't want to
+        keep all that unneeded code.
+
+        * bindings/js/JSAudioTrackCustom.cpp:
+        (WebCore::JSAudioTrack::setKind): Removed the isEmpty clause here. I presume this
+        was copied and pasted from script-generated bindings. While I was at it, I used a
+        slightly more efficient code path that avoids doing a ref/deref on the string by
+        using auto&. That's trickier to do correctly for functions with more than one
+        argument, so I didn't do it in the bindings generator yet.
+        (WebCore::JSAudioTrack::setLanguage): Ditto.
+        * bindings/js/JSTextTrackCustom.cpp:
+        (WebCore::JSTextTrack::setKind): Ditto.
+        (WebCore::JSTextTrack::setLanguage): Ditto.
+        * bindings/js/JSVideoTrackCustom.cpp:
+        (WebCore::JSVideoTrack::setKind): Ditto.
+        (WebCore::JSVideoTrack::setLanguage): Ditto.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation): Use "=" syntax instead of constructor style syntax for
+        the argument processing. I think this is more readable.
+        (GenerateParametersCheck): For the enum code path, did the more efficient auto&
+        idiom to avoid ref/deref on a string. For the toExistingAtomicString path,
+        restructured so we don't have to check the flag indicating that something is atomic.
+        Later we could also avoid the ref/deref; added a FIXME about that.
+        (GetNativeType): Use String, not const String, for local variables. Sure, the
+        string is const, but so is every other local variable type we use! No need to be
+        wordy about it.
+        (JSValueToNative): Removed the uneeded calls to isEmpty. Since the call sites no
+        longer use construction syntax, used initializer syntax style for a couple classes
+        that are constructed with multiple arguments.
+
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Updated.
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
+
 2015-06-09  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Fix unused private field warning in GraphicsLayerUpdater.h
index a3aaba6444686e84456ce5bcbec38d392d5e252f..4400579e3649771776c65d6a46f5d83b2ea86cc6 100644 (file)
@@ -43,10 +43,10 @@ void JSAudioTrack::visitAdditionalChildren(SlotVisitor& visitor)
 void JSAudioTrack::setKind(ExecState* exec, JSValue value)
 {
 #if ENABLE(MEDIA_SOURCE)
-    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    auto& string = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl().setKind(nativeValue);
+    impl().setKind(string);
 #else
     UNUSED_PARAM(exec);
     UNUSED_PARAM(value);
@@ -56,10 +56,10 @@ void JSAudioTrack::setKind(ExecState* exec, JSValue value)
 void JSAudioTrack::setLanguage(ExecState* exec, JSValue value)
 {
 #if ENABLE(MEDIA_SOURCE)
-    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    auto& string = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl().setLanguage(nativeValue);
+    impl().setLanguage(string);
 #else
     UNUSED_PARAM(exec);
     UNUSED_PARAM(value);
index bb96c201e0d053c14dff29b203e9c03f1c693869..1885c577e5258ae3de5d2d2d2adfcb309391ff77 100644 (file)
@@ -43,29 +43,27 @@ void JSTextTrack::visitAdditionalChildren(SlotVisitor& visitor)
 
 void JSTextTrack::setKind(ExecState* exec, JSValue value)
 {
-    UNUSED_PARAM(exec);
 #if ENABLE(MEDIA_SOURCE)
-    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    auto& string = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl().setKind(nativeValue);
+    impl().setKind(string);
 #else
+    UNUSED_PARAM(exec);
     UNUSED_PARAM(value);
-    return;
 #endif
 }
 
 void JSTextTrack::setLanguage(ExecState* exec, JSValue value)
 {
-    UNUSED_PARAM(exec);
 #if ENABLE(MEDIA_SOURCE)
-    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    auto& string = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl().setLanguage(nativeValue);
+    impl().setLanguage(string);
 #else
+    UNUSED_PARAM(exec);
     UNUSED_PARAM(value);
-    return;
 #endif
 }
 
index e7bcba215e4f4a84ee8841ccb327898c6c89e993..9486788a66b2421377dac5106b6bf55267627f00 100644 (file)
@@ -42,29 +42,27 @@ void JSVideoTrack::visitAdditionalChildren(SlotVisitor& visitor)
 
 void JSVideoTrack::setKind(ExecState* exec, JSValue value)
 {
-    UNUSED_PARAM(exec);
 #if ENABLE(MEDIA_SOURCE)
-    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    auto& string = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl().setKind(nativeValue);
+    impl().setKind(string);
 #else
+    UNUSED_PARAM(exec);
     UNUSED_PARAM(value);
-    return;
 #endif
 }
 
 void JSVideoTrack::setLanguage(ExecState* exec, JSValue value)
 {
-    UNUSED_PARAM(exec);
 #if ENABLE(MEDIA_SOURCE)
-    const String& nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    auto& string = value.toString(exec)->value(exec);
     if (exec->hadException())
         return;
-    impl().setLanguage(nativeValue);
+    impl().setLanguage(string);
 #else
+    UNUSED_PARAM(exec);
     UNUSED_PARAM(value);
-    return;
 #endif
 }
 
index 844f63071a2e1e860850ccd73aded8ebfacc31db..c14deda9bfef130d6dc79e5a4cd72c2c1c926b97 100644 (file)
@@ -2638,7 +2638,7 @@ sub GenerateImplementation
                     }
                 }
 
-                push(@implContent, "    " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue(" . JSValueToNative($attribute->signature, "value", $attribute->signature->extendedAttributes->{"Conditional"}) . ");\n");
+                push(@implContent, "    " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue = " . JSValueToNative($attribute->signature, "value", $attribute->signature->extendedAttributes->{"Conditional"}) . ";\n");
                 push(@implContent, "    if (UNLIKELY(exec->hadException()))\n");
                 push(@implContent, "        return;\n");
 
@@ -3294,9 +3294,11 @@ sub GenerateParametersCheck
             $implIncludes{"<runtime/Error.h>"} = 1;
 
             my $argValue = "exec->argument($argsIndex)";
-            push(@$outputArray, "    const String ${name}(${argValue}.isEmpty() ? String() : ${argValue}.toString(exec)->value(exec));\n");
+            push(@$outputArray, "    // Keep pointer to the JSString in a local so we don't need to ref the String.\n");
+            push(@$outputArray, "    auto* ${name}String = ${argValue}.toString(exec);\n");
             push(@$outputArray, "    if (UNLIKELY(exec->hadException()))\n");
             push(@$outputArray, "        return JSValue::encode(jsUndefined());\n");
+            push(@$outputArray, "    auto& $name = ${name}String->value(exec);\n");
 
             my @enumValues = $codeGenerator->ValidEnumValues($argType);
             my @enumChecks = ();
@@ -3328,12 +3330,12 @@ sub GenerateParametersCheck
             }
 
             if ($parameter->extendedAttributes->{"RequiresExistingAtomicString"}) {
-                push(@$outputArray, "    RefPtr<AtomicStringImpl> existing_$name = exec->argument($argsIndex).isEmpty() ? nullptr : exec->argument($argsIndex).toString(exec)->toExistingAtomicString(exec);\n");
-                push(@$outputArray, "    if (!existing_$name)\n");
+                # FIXME: This could be made slightly more efficient if we added an AtomicString(RefPtr<AtomicStringImpl>&&) constructor and removed the call to get() here.
+                push(@$outputArray, "    AtomicString $name = exec->argument($argsIndex).toString(exec)->toExistingAtomicString(exec).get();\n");
+                push(@$outputArray, "    if ($name.isNull())\n");
                 push(@$outputArray, "        return JSValue::encode(jsNull());\n");
-                push(@$outputArray, "    const AtomicString $name(*existing_$name);\n");
             } else {
-                push(@$outputArray, "    " . GetNativeTypeFromSignature($parameter) . " $name(" . JSValueToNative($parameter, $optional && $defaultAttribute && $defaultAttribute eq "NullString" ? "argumentOrNull(exec, $argsIndex)" : "exec->argument($argsIndex)", $function->signature->extendedAttributes->{"Conditional"}) . ");\n");
+                push(@$outputArray, "    " . GetNativeTypeFromSignature($parameter) . " $name = " . JSValueToNative($parameter, $optional && $defaultAttribute && $defaultAttribute eq "NullString" ? "argumentOrNull(exec, $argsIndex)" : "exec->argument($argsIndex)", $function->signature->extendedAttributes->{"Conditional"}) . ";\n");
             }
 
             # If a parameter is "an index" and it's negative it should throw an INDEX_SIZE_ERR exception.
@@ -3672,7 +3674,7 @@ sub GetNativeTypeFromSignature
 
 my %nativeType = (
     "CompareHow" => "Range::CompareHow",
-    "DOMString" => "const String",
+    "DOMString" => "String",
     "NodeFilter" => "RefPtr<NodeFilter>",
     "SerializedScriptValue" => "RefPtr<SerializedScriptValue>",
     "Date" => "double",
@@ -3711,7 +3713,7 @@ sub GetNativeType
     return "Vector<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">" if $arrayOrSequenceType;
 
     if ($codeGenerator->IsEnumType($type)) {
-        return "const String";
+        return "String";
     }
 
     # For all other types, the native type is a pointer with same type name as the IDL type.
@@ -3823,14 +3825,14 @@ sub JSValueToNative
             return "valueToStringWithNullCheck(exec, $value)"
         }
         if ($signature->extendedAttributes->{"AtomicString"}) {
-            return "$value.isEmpty() ? AtomicString() : $value.toString(exec)->toAtomicString(exec)";
+            return "$value.toString(exec)->toAtomicString(exec)";
         }
         # FIXME: Add the case for 'if ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString"))'.
-        return "$value.isEmpty() ? String() : $value.toString(exec)->value(exec)";
+        return "$value.toString(exec)->value(exec)";
     }
 
     if ($type eq "any") {
-        return "exec->vm(), $value";
+        return "{ exec->vm(), $value }";
     }
 
     if ($type eq "NodeFilter") {
@@ -3845,7 +3847,7 @@ sub JSValueToNative
 
     if ($type eq "Dictionary") {
         AddToImplIncludes("Dictionary.h", $conditional);
-        return "exec, $value";
+        return "{ exec, $value }";
     }
 
     if ($type eq "DOMStringList" ) {
@@ -3873,7 +3875,7 @@ sub JSValueToNative
     }
 
     if ($codeGenerator->IsEnumType($type)) {
-        return "$value.isEmpty() ? String() : $value.toString(exec)->value(exec)";
+        return "$value.toString(exec)->value(exec)";
     }
 
     # Default, assume autogenerated type conversion routines
index d4e3629dcf6a28720fb7b171cf94fd933270c0e0..35e8ad3698496dbcc41eb9f6213fb929fc88ad4d 100644 (file)
@@ -214,7 +214,7 @@ EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunct
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Node* nextChild(JSNode::toWrapped(exec->argument(0)));
+    Node* nextChild = JSNode::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.excitingFunction(nextChild);
@@ -231,7 +231,7 @@ EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionPostMessage(E
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String message(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String message = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.postMessage(message);
index 24e26a334caad1c8ca0042479e138b0d09ae2512..b0ad9dc6bdae304b08017827db6b9676feeeb666 100644 (file)
@@ -205,7 +205,7 @@ EncodedJSValue JSC_HOST_CALL jsTestCustomNamedGetterPrototypeFunctionAnotherFunc
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String str = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.anotherFunction(str);
index b31aff01cbb07e9ee3dae2f92d7eca5798f91e4d..5d14c4c0cca632445b4ad310a51818e89c438932 100644 (file)
@@ -243,7 +243,7 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionItem(ExecState* e
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int index(toUInt32(exec, exec->argument(0), NormalConversion));
+    int index = toUInt32(exec, exec->argument(0), NormalConversion);
     if (index < 0) {
         setDOMException(exec, INDEX_SIZE_ERR);
         return JSValue::encode(jsUndefined());
@@ -295,7 +295,7 @@ EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(Exe
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    Event* evt(JSEvent::toWrapped(exec->argument(0)));
+    Event* evt = JSEvent::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsBoolean(impl.dispatchEvent(evt, ec));
index b4a17730b536119116f4f952a09d7d0f4db11c23..cc03cb8aa2cbbf3c4da37304446f361295d5ccfc 100644 (file)
@@ -272,10 +272,10 @@ EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterfac
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    const String str1(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String str1 = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String str2(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String str2 = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     ScriptExecutionContext* context = castedThis->scriptExecutionContext();
@@ -663,7 +663,7 @@ void setJSTestInterfaceConstructorImplementsStaticAttr(ExecState* exec, JSObject
 {
     JSValue value = JSValue::decode(encodedValue);
     UNUSED_PARAM(baseObject);
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     TestInterface::setImplementsStaticAttr(nativeValue);
@@ -685,7 +685,7 @@ void setJSTestInterfaceImplementsStr2(ExecState* exec, JSObject* baseObject, Enc
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setImplementsStr2(nativeValue);
@@ -721,7 +721,7 @@ void setJSTestInterfaceImplementsNode(ExecState* exec, JSObject* baseObject, Enc
         return;
     }
     auto& impl = castedThis->impl();
-    Node* nativeValue(JSNode::toWrapped(value));
+    Node* nativeValue = JSNode::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setImplementsNode(nativeValue);
@@ -734,7 +734,7 @@ void setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* exec, JSObje
 {
     JSValue value = JSValue::decode(encodedValue);
     UNUSED_PARAM(baseObject);
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     TestSupplemental::setSupplementalStaticAttr(nativeValue);
@@ -756,7 +756,7 @@ void setJSTestInterfaceSupplementalStr2(ExecState* exec, JSObject* baseObject, E
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     TestSupplemental::setSupplementalStr2(&impl, nativeValue);
@@ -792,7 +792,7 @@ void setJSTestInterfaceSupplementalNode(ExecState* exec, JSObject* baseObject, E
         return;
     }
     auto& impl = castedThis->impl();
-    Node* nativeValue(JSNode::toWrapped(value));
+    Node* nativeValue = JSNode::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     TestSupplemental::setSupplementalNode(&impl, nativeValue);
@@ -835,10 +835,10 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(E
     auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String strArg = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(1)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(1));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(scriptContext, strArg, objArg, ec)));
@@ -901,10 +901,10 @@ EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2
     auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     if (!scriptContext)
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String strArg = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(1)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(1));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(&impl, scriptContext, strArg, objArg, ec)));
index 62f843234be11ec51026174f32f3bbffa7ef1f08..ff7ae417865aa4d8a69f2e2df79144d176f86d69 100644 (file)
@@ -128,13 +128,13 @@ EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor::constructJS
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    const String str1(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String str1 = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String str2(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String str2 = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String str3(argumentOrNull(exec, 2).isEmpty() ? String() : argumentOrNull(exec, 2).toString(exec)->value(exec));
+    String str3 = argumentOrNull(exec, 2).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     RefPtr<TestNamedConstructor> object = TestNamedConstructor::createForJSConstructor(*castedThis->document(), str1, str2, str3, ec);
index 7e946f5a289c6e0adec9e530a93d5c674daef402..cff7c766b0b913f58a3aa3ab8d51f19cd2e48d46 100644 (file)
@@ -378,7 +378,7 @@ void setJSTestNondeterministicNondeterministicWriteableAttr(ExecState* exec, JSO
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setNondeterministicWriteableAttr(nativeValue);
@@ -398,7 +398,7 @@ void setJSTestNondeterministicNondeterministicExceptionAttr(ExecState* exec, JSO
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setNondeterministicExceptionAttr(nativeValue);
@@ -418,7 +418,7 @@ void setJSTestNondeterministicNondeterministicGetterExceptionAttr(ExecState* exe
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setNondeterministicGetterExceptionAttr(nativeValue);
@@ -439,7 +439,7 @@ void setJSTestNondeterministicNondeterministicSetterExceptionAttr(ExecState* exe
     }
     auto& impl = castedThis->impl();
     ExceptionCode ec = 0;
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setNondeterministicSetterExceptionAttr(nativeValue, ec);
index 219f35f10fd3e77d4765b51b06b1bb828cbc0fed..0e8a3dea2ec90f3355a9dec2fbbb45f753a71f4b 100644 (file)
@@ -1894,7 +1894,7 @@ void setJSTestObjConstructorStaticStringAttr(ExecState* exec, JSObject* baseObje
 {
     JSValue value = JSValue::decode(encodedValue);
     UNUSED_PARAM(baseObject);
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     TestObj::setStaticStringAttr(nativeValue);
@@ -1927,7 +1927,7 @@ void setJSTestObjEnumAttr(ExecState* exec, JSObject* baseObject, EncodedJSValue
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     if (nativeValue != "" && nativeValue != "EnumValue1" && nativeValue != "EnumValue2" && nativeValue != "EnumValue3")
@@ -1949,7 +1949,7 @@ void setJSTestObjByteAttr(ExecState* exec, JSObject* baseObject, EncodedJSValue
         return;
     }
     auto& impl = castedThis->impl();
-    int8_t nativeValue(toInt8(exec, value, NormalConversion));
+    int8_t nativeValue = toInt8(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setByteAttr(nativeValue);
@@ -1969,7 +1969,7 @@ void setJSTestObjOctetAttr(ExecState* exec, JSObject* baseObject, EncodedJSValue
         return;
     }
     auto& impl = castedThis->impl();
-    uint8_t nativeValue(toUInt8(exec, value, NormalConversion));
+    uint8_t nativeValue = toUInt8(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setOctetAttr(nativeValue);
@@ -1989,7 +1989,7 @@ void setJSTestObjShortAttr(ExecState* exec, JSObject* baseObject, EncodedJSValue
         return;
     }
     auto& impl = castedThis->impl();
-    int16_t nativeValue(toInt16(exec, value, NormalConversion));
+    int16_t nativeValue = toInt16(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setShortAttr(nativeValue);
@@ -2009,7 +2009,7 @@ void setJSTestObjUnsignedShortAttr(ExecState* exec, JSObject* baseObject, Encode
         return;
     }
     auto& impl = castedThis->impl();
-    uint16_t nativeValue(toUInt16(exec, value, NormalConversion));
+    uint16_t nativeValue = toUInt16(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setUnsignedShortAttr(nativeValue);
@@ -2029,7 +2029,7 @@ void setJSTestObjLongAttr(ExecState* exec, JSObject* baseObject, EncodedJSValue
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setLongAttr(nativeValue);
@@ -2049,7 +2049,7 @@ void setJSTestObjLongLongAttr(ExecState* exec, JSObject* baseObject, EncodedJSVa
         return;
     }
     auto& impl = castedThis->impl();
-    long long nativeValue(toInt64(exec, value, NormalConversion));
+    long long nativeValue = toInt64(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setLongLongAttr(nativeValue);
@@ -2069,7 +2069,7 @@ void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* baseObject, Enc
         return;
     }
     auto& impl = castedThis->impl();
-    unsigned long long nativeValue(toUInt64(exec, value, NormalConversion));
+    unsigned long long nativeValue = toUInt64(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setUnsignedLongLongAttr(nativeValue);
@@ -2089,7 +2089,7 @@ void setJSTestObjStringAttr(ExecState* exec, JSObject* baseObject, EncodedJSValu
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setStringAttr(nativeValue);
@@ -2109,7 +2109,7 @@ void setJSTestObjTestObjAttr(ExecState* exec, JSObject* baseObject, EncodedJSVal
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setTestObjAttr(nativeValue);
@@ -2129,7 +2129,7 @@ void setJSTestObjXMLObjAttr(ExecState* exec, JSObject* baseObject, EncodedJSValu
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setXMLObjAttr(nativeValue);
@@ -2149,7 +2149,7 @@ void setJSTestObjCreate(ExecState* exec, JSObject* baseObject, EncodedJSValue th
         return;
     }
     auto& impl = castedThis->impl();
-    bool nativeValue(value.toBoolean(exec));
+    bool nativeValue = value.toBoolean(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setCreate(nativeValue);
@@ -2169,7 +2169,7 @@ void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* baseObject, Enco
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(valueToStringWithNullCheck(exec, value));
+    String nativeValue = valueToStringWithNullCheck(exec, value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedstringattrAttr, nativeValue);
@@ -2189,7 +2189,7 @@ void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* baseObject, En
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, nativeValue);
@@ -2209,7 +2209,7 @@ void setJSTestObjReflectedUnsignedIntegralAttr(ExecState* exec, JSObject* baseOb
         return;
     }
     auto& impl = castedThis->impl();
-    unsigned nativeValue(toUInt32(exec, value, NormalConversion));
+    unsigned nativeValue = toUInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, nativeValue);
@@ -2229,7 +2229,7 @@ void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* baseObject, Enc
         return;
     }
     auto& impl = castedThis->impl();
-    bool nativeValue(value.toBoolean(exec));
+    bool nativeValue = value.toBoolean(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, nativeValue);
@@ -2249,7 +2249,7 @@ void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* baseObject, Encoded
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(valueToStringWithNullCheck(exec, value));
+    String nativeValue = valueToStringWithNullCheck(exec, value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedurlattrAttr, nativeValue);
@@ -2269,7 +2269,7 @@ void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* baseObject, Enco
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(valueToStringWithNullCheck(exec, value));
+    String nativeValue = valueToStringWithNullCheck(exec, value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::customContentStringAttrAttr, nativeValue);
@@ -2289,7 +2289,7 @@ void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* baseObje
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, nativeValue);
@@ -2309,7 +2309,7 @@ void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* baseObjec
         return;
     }
     auto& impl = castedThis->impl();
-    bool nativeValue(value.toBoolean(exec));
+    bool nativeValue = value.toBoolean(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, nativeValue);
@@ -2329,7 +2329,7 @@ void setJSTestObjReflectedCustomURLAttr(ExecState* exec, JSObject* baseObject, E
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(valueToStringWithNullCheck(exec, value));
+    String nativeValue = valueToStringWithNullCheck(exec, value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::customContentURLAttrAttr, nativeValue);
@@ -2349,7 +2349,7 @@ void setJSTestObjTypedArrayAttr(ExecState* exec, JSObject* baseObject, EncodedJS
         return;
     }
     auto& impl = castedThis->impl();
-    RefPtr<Float32Array> nativeValue(toFloat32Array(value));
+    RefPtr<Float32Array> nativeValue = toFloat32Array(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setTypedArrayAttr(nativeValue.get());
@@ -2369,7 +2369,7 @@ void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* baseObject,
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttrWithGetterException(nativeValue);
@@ -2390,7 +2390,7 @@ void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* baseObject,
     }
     auto& impl = castedThis->impl();
     ExceptionCode ec = 0;
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttrWithSetterException(nativeValue, ec);
@@ -2411,7 +2411,7 @@ void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* baseOb
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setStringAttrWithGetterException(nativeValue);
@@ -2432,7 +2432,7 @@ void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* baseOb
     }
     auto& impl = castedThis->impl();
     ExceptionCode ec = 0;
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setStringAttrWithSetterException(nativeValue, ec);
@@ -2481,7 +2481,7 @@ void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* baseObject,
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setWithScriptStateAttribute(exec, nativeValue);
@@ -2501,7 +2501,7 @@ void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject*
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
@@ -2524,7 +2524,7 @@ void setJSTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* baseO
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setWithScriptStateAttributeRaises(exec, nativeValue);
@@ -2544,7 +2544,7 @@ void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSOb
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
@@ -2567,7 +2567,7 @@ void setJSTestObjWithScriptExecutionContextAndScriptStateAttribute(ExecState* ex
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
@@ -2590,7 +2590,7 @@ void setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises(ExecSta
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
@@ -2613,7 +2613,7 @@ void setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute(Exe
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
@@ -2636,7 +2636,7 @@ void setJSTestObjWithScriptArgumentsAndCallStackAttribute(ExecState* exec, JSObj
         return;
     }
     auto& impl = castedThis->impl();
-    TestObj* nativeValue(JSTestObj::toWrapped(value));
+    TestObj* nativeValue = JSTestObj::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setWithScriptArgumentsAndCallStackAttribute(nativeValue);
@@ -2657,7 +2657,7 @@ void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* baseObject, Encoded
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setConditionalAttr1(nativeValue);
@@ -2679,7 +2679,7 @@ void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* baseObject, Encoded
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setConditionalAttr2(nativeValue);
@@ -2701,7 +2701,7 @@ void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* baseObject, Encoded
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setConditionalAttr3(nativeValue);
@@ -2767,7 +2767,7 @@ void setJSTestObjAnyAttribute(ExecState* exec, JSObject* baseObject, EncodedJSVa
         return;
     }
     auto& impl = castedThis->impl();
-    Deprecated::ScriptValue nativeValue(exec->vm(), value);
+    Deprecated::ScriptValue nativeValue = { exec->vm(), value };
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAnyAttribute(nativeValue);
@@ -2787,7 +2787,7 @@ void setJSTestObjMutablePoint(ExecState* exec, JSObject* baseObject, EncodedJSVa
         return;
     }
     auto& impl = castedThis->impl();
-    SVGPropertyTearOff<SVGPoint>* nativeValue(JSSVGPoint::toWrapped(value));
+    SVGPropertyTearOff<SVGPoint>* nativeValue = JSSVGPoint::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setMutablePoint(nativeValue);
@@ -2807,7 +2807,7 @@ void setJSTestObjImmutablePoint(ExecState* exec, JSObject* baseObject, EncodedJS
         return;
     }
     auto& impl = castedThis->impl();
-    SVGPropertyTearOff<SVGPoint>* nativeValue(JSSVGPoint::toWrapped(value));
+    SVGPropertyTearOff<SVGPoint>* nativeValue = JSSVGPoint::toWrapped(value);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setImmutablePoint(nativeValue);
@@ -2827,7 +2827,7 @@ void setJSTestObjStrawberry(ExecState* exec, JSObject* baseObject, EncodedJSValu
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setBlueberry(nativeValue);
@@ -2847,7 +2847,7 @@ void setJSTestObjStrictFloat(ExecState* exec, JSObject* baseObject, EncodedJSVal
         return;
     }
     auto& impl = castedThis->impl();
-    float nativeValue(value.toFloat(exec));
+    float nativeValue = value.toFloat(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setStrictFloat(nativeValue);
@@ -2867,7 +2867,7 @@ void setJSTestObjId(ExecState* exec, JSObject* baseObject, EncodedJSValue thisVa
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setId(nativeValue);
@@ -2904,7 +2904,7 @@ void setJSTestObjNullableLongSettableAttribute(ExecState* exec, JSObject* baseOb
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setNullableLongSettableAttribute(nativeValue);
@@ -2924,7 +2924,7 @@ void setJSTestObjNullableStringValue(ExecState* exec, JSObject* baseObject, Enco
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setNullableStringValue(nativeValue);
@@ -2944,7 +2944,7 @@ void setJSTestObjAttributeWithReservedEnumType(ExecState* exec, JSObject* baseOb
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     if (nativeValue != "" && nativeValue != "OptionalValue1" && nativeValue != "OptionalValue2" && nativeValue != "OptionalValue3")
@@ -2980,13 +2980,13 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecSt
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 3))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int longArg(toInt32(exec, exec->argument(0), NormalConversion));
+    int longArg = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String strArg = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(2)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(2));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.voidMethodWithArgs(longArg, strArg, objArg);
@@ -3015,13 +3015,13 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionByteMethodWithArgs(ExecSt
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 3))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int8_t byteArg(toInt8(exec, exec->argument(0), NormalConversion));
+    int8_t byteArg = toInt8(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String strArg = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(2)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(2));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsNumber(impl.byteMethodWithArgs(byteArg, strArg, objArg));
@@ -3050,13 +3050,13 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOctetMethodWithArgs(ExecS
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 3))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    uint8_t octetArg(toUInt8(exec, exec->argument(0), NormalConversion));
+    uint8_t octetArg = toUInt8(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String strArg = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(2)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(2));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsNumber(impl.octetMethodWithArgs(octetArg, strArg, objArg));
@@ -3085,13 +3085,13 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionLongMethodWithArgs(ExecSt
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 3))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int longArg(toInt32(exec, exec->argument(0), NormalConversion));
+    int longArg = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String strArg = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(2)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(2));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsNumber(impl.longMethodWithArgs(longArg, strArg, objArg));
@@ -3120,13 +3120,13 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecSta
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 3))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int longArg(toInt32(exec, exec->argument(0), NormalConversion));
+    int longArg = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String strArg = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(2)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(2));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.objMethodWithArgs(longArg, strArg, objArg)));
@@ -3143,7 +3143,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(Exe
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<RefPtr<ScriptProfile>> sequenceArg((toRefPtrNativeArray<ScriptProfile, JSScriptProfile>(exec, exec->argument(0), &JSScriptProfile::toWrapped)));
+    Vector<RefPtr<ScriptProfile>> sequenceArg = (toRefPtrNativeArray<ScriptProfile, JSScriptProfile>(exec, exec->argument(0), &JSScriptProfile::toWrapped));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithSequenceArg(sequenceArg);
@@ -3160,7 +3160,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(E
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int longArg(toInt32(exec, exec->argument(0), NormalConversion));
+    int longArg = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsArray(exec, castedThis->globalObject(), impl.methodReturningSequence(longArg));
@@ -3177,9 +3177,11 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithEnumArg(ExecSta
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String enumArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    // Keep pointer to the JSString in a local so we don't need to ref the String.
+    auto* enumArgString = exec->argument(0).toString(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
+    auto& enumArg = enumArgString->value(exec);
     if (enumArg != "" && enumArg != "EnumValue1" && enumArg != "EnumValue2" && enumArg != "EnumValue3")
         return throwArgumentMustBeEnumError(*exec, 0, "enumArg", "TestObj", "methodWithEnumArg", "\"\", \"EnumValue1\", \"EnumValue2\", \"EnumValue3\"");
     impl.methodWithEnumArg(enumArg);
@@ -3197,10 +3199,10 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgs
     if (UNLIKELY(exec->argumentCount() < 2))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    const String strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String strArg = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(1)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(1));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
@@ -3219,7 +3221,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    RefPtr<SerializedScriptValue> serializedArg(SerializedScriptValue::create(exec, exec->argument(0), 0, 0));
+    RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(exec, exec->argument(0), 0, 0);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.serializedValue(serializedArg);
@@ -3236,10 +3238,10 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState*
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Dictionary oo(exec, exec->argument(0));
+    Dictionary oo = { exec, exec->argument(0) };
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    Dictionary ooo(exec, exec->argument(1));
+    Dictionary ooo = { exec, exec->argument(1) };
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.optionsObject(oo, ooo);
@@ -3462,7 +3464,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(Exe
         return JSValue::encode(jsUndefined());
     }
 
-    int opt(toInt32(exec, exec->argument(0), NormalConversion));
+    int opt = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithOptionalArg(opt);
@@ -3479,7 +3481,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int nonOpt(toInt32(exec, exec->argument(0), NormalConversion));
+    int nonOpt = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
 
@@ -3489,7 +3491,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
         return JSValue::encode(jsUndefined());
     }
 
-    int opt(toInt32(exec, exec->argument(1), NormalConversion));
+    int opt = toInt32(exec, exec->argument(1), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
@@ -3506,7 +3508,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int nonOpt(toInt32(exec, exec->argument(0), NormalConversion));
+    int nonOpt = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
 
@@ -3516,7 +3518,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
         return JSValue::encode(jsUndefined());
     }
 
-    int opt1(toInt32(exec, exec->argument(1), NormalConversion));
+    int opt1 = toInt32(exec, exec->argument(1), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     if (argsCount <= 2) {
@@ -3524,7 +3526,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
         return JSValue::encode(jsUndefined());
     }
 
-    int opt2(toInt32(exec, exec->argument(2), NormalConversion));
+    int opt2 = toInt32(exec, exec->argument(2), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
@@ -3546,7 +3548,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalString(
         return JSValue::encode(jsUndefined());
     }
 
-    const String str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String str = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithOptionalString(str);
@@ -3561,7 +3563,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringI
         return throwThisTypeError(*exec, "TestObj", "methodWithOptionalStringIsUndefined");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->impl();
-    const String str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String str = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithOptionalStringIsUndefined(str);
@@ -3576,7 +3578,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalStringI
         return throwThisTypeError(*exec, "TestObj", "methodWithOptionalStringIsNullString");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->impl();
-    const String str(argumentOrNull(exec, 0).isEmpty() ? String() : argumentOrNull(exec, 0).toString(exec)->value(exec));
+    String str = argumentOrNull(exec, 0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithOptionalStringIsNullString(str);
@@ -3610,7 +3612,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgA
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 2))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int nonCallback(toInt32(exec, exec->argument(0), NormalConversion));
+    int nonCallback = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     if (!exec->argument(1).isFunction())
@@ -3716,10 +3718,10 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 2))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(0)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    const String strArg(exec->argument(1).isEmpty() ? String() : exec->argument(1).toString(exec)->value(exec));
+    String strArg = exec->argument(1).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(objArg, strArg);
@@ -3736,7 +3738,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(0)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
 
@@ -3746,7 +3748,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(
         return JSValue::encode(jsUndefined());
     }
 
-    int longArg(toInt32(exec, exec->argument(1), NormalConversion));
+    int longArg = toInt32(exec, exec->argument(1), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(objArg, longArg);
@@ -3763,7 +3765,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String strArg = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(strArg);
@@ -3780,7 +3782,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int longArg(toInt32(exec, exec->argument(0), NormalConversion));
+    int longArg = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(longArg);
@@ -3814,7 +3816,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod6(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    RefPtr<DOMStringList> listArg(toDOMStringList(exec, exec->argument(0)));
+    RefPtr<DOMStringList> listArg = toDOMStringList(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(listArg);
@@ -3831,7 +3833,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod7(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<String> arrayArg(toNativeArray<String>(exec, exec->argument(0)));
+    Vector<String> arrayArg = toNativeArray<String>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(arrayArg);
@@ -3848,7 +3850,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod8(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(0)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(objArg);
@@ -3865,7 +3867,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod9(
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<String> arrayArg(toNativeArray<String>(exec, exec->argument(0)));
+    Vector<String> arrayArg = toNativeArray<String>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(arrayArg);
@@ -3882,7 +3884,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod10
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<unsigned> arrayArg(toNativeArray<unsigned>(exec, exec->argument(0)));
+    Vector<unsigned> arrayArg = toNativeArray<unsigned>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(arrayArg);
@@ -3899,7 +3901,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod11
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String strArg(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String strArg = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.overloadedMethod(strArg);
@@ -3953,7 +3955,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethodWithOptional
         return JSValue::encode(result);
     }
 
-    int arg(toInt32(exec, exec->argument(0), NormalConversion));
+    int arg = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsNumber(TestObj::classMethodWithOptional(arg));
@@ -3972,7 +3974,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod
 {
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    int arg(toInt32(exec, exec->argument(0), NormalConversion));
+    int arg = toInt32(exec, exec->argument(0), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     TestObj::overloadedMethod1(arg);
@@ -3986,7 +3988,7 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod
 {
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String type(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String type = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     TestObj::overloadedMethod1(type);
@@ -4054,7 +4056,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithUnsignedLongSeq
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<unsigned> unsignedLongSequence(toNativeArray<unsigned>(exec, exec->argument(0)));
+    Vector<unsigned> unsignedLongSequence = toNativeArray<unsigned>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithUnsignedLongSequence(unsignedLongSequence);
@@ -4072,7 +4074,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStringArrayFunction(ExecS
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    Vector<String> values(toNativeArray<String>(exec, exec->argument(0)));
+    Vector<String> values = toNativeArray<String>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsArray(exec, castedThis->globalObject(), impl.stringArrayFunction(values, ec));
@@ -4092,7 +4094,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionDomStringListFunction(Exe
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    RefPtr<DOMStringList> values(toDOMStringList(exec, exec->argument(0)));
+    RefPtr<DOMStringList> values = toDOMStringList(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.domStringListFunction(values, ec)));
@@ -4111,10 +4113,10 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithAndWithoutNulla
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 2))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<unsigned> arrayArg(toNativeArray<unsigned>(exec, exec->argument(0)));
+    Vector<unsigned> arrayArg = toNativeArray<unsigned>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    Vector<unsigned> nullableArrayArg(toNativeArray<unsigned>(exec, exec->argument(1)));
+    Vector<unsigned> nullableArrayArg = toNativeArray<unsigned>(exec, exec->argument(1));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithAndWithoutNullableSequence(arrayArg, nullableArrayArg);
@@ -4131,10 +4133,10 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithAndWithoutNulla
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 2))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<unsigned> arrayArg(toNativeArray<unsigned>(exec, exec->argument(0)));
+    Vector<unsigned> arrayArg = toNativeArray<unsigned>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    Vector<unsigned> nullableArrayArg(toNativeArray<unsigned>(exec, exec->argument(1)));
+    Vector<unsigned> nullableArrayArg = toNativeArray<unsigned>(exec, exec->argument(1));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.methodWithAndWithoutNullableSequence2(arrayArg, nullableArrayArg);
@@ -4168,7 +4170,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(ExecState* exec)
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    TestNode* value(JSTestNode::toWrapped(exec->argument(0)));
+    TestNode* value = JSTestNode::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.convert1(value);
@@ -4185,7 +4187,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* exec)
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    TestNode* value(JSTestNode::toWrapped(exec->argument(0)));
+    TestNode* value = JSTestNode::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.convert2(value);
@@ -4202,7 +4204,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* exec)
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    TestNode* value(JSTestNode::toWrapped(exec->argument(0)));
+    TestNode* value = JSTestNode::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.convert4(value);
@@ -4219,7 +4221,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(ExecState* exec)
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    TestNode* value(JSTestNode::toWrapped(exec->argument(0)));
+    TestNode* value = JSTestNode::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.convert5(value);
@@ -4273,13 +4275,13 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunction(ExecState*
     if (UNLIKELY(exec->argumentCount() < 3))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    const String str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String str = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    float a(exec->argument(1).toFloat(exec));
+    float a = exec->argument(1).toFloat(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    int b(toInt32(exec, exec->argument(2), NormalConversion));
+    int b = toInt32(exec, exec->argument(2), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.strictFunction(str, a, b, ec)));
@@ -4301,10 +4303,10 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunctionWithSequenc
     ExceptionCode ec = 0;
     if (!exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(JSTestObj::info()))
         return throwArgumentTypeError(*exec, 0, "objArg", "TestObj", "strictFunctionWithSequence", "TestObj");
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(0)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    Vector<unsigned> a(toNativeArray<unsigned>(exec, exec->argument(1)));
+    Vector<unsigned> a = toNativeArray<unsigned>(exec, exec->argument(1));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.strictFunctionWithSequence(objArg, a, ec)));
@@ -4326,10 +4328,10 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunctionWithArray(E
     ExceptionCode ec = 0;
     if (!exec->argument(0).isUndefinedOrNull() && !exec->argument(0).inherits(JSTestObj::info()))
         return throwArgumentTypeError(*exec, 0, "objArg", "TestObj", "strictFunctionWithArray", "TestObj");
-    TestObj* objArg(JSTestObj::toWrapped(exec->argument(0)));
+    TestObj* objArg = JSTestObj::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    Vector<int> array(toNativeArray<int>(exec, exec->argument(1)));
+    Vector<int> array = toNativeArray<int>(exec, exec->argument(1));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.strictFunctionWithArray(objArg, array, ec)));
@@ -4348,7 +4350,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicStringMethod(Exec
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String head(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String head = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     Vector<String> tail = toNativeArguments<String>(exec, 1);
@@ -4368,7 +4370,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicDoubleMethod(Exec
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    double head(exec->argument(0).toNumber(exec));
+    double head = exec->argument(0).toNumber(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     Vector<double> tail = toNativeArguments<double>(exec, 1);
@@ -4388,7 +4390,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicNodeMethod(ExecSt
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Node* head(JSNode::toWrapped(exec->argument(0)));
+    Node* head = JSNode::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     Vector<Node*> tail;
@@ -4411,10 +4413,10 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAny(ExecState* exec)
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 2))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    float a(exec->argument(0).toFloat(exec));
+    float a = exec->argument(0).toFloat(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    int b(toInt32(exec, exec->argument(1), NormalConversion));
+    int b = toInt32(exec, exec->argument(1), NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.any(a, b);
index e2fa2120aa08fa86151a805351a3485b54ae0719..3603f5f51af646eeb599ab8e61e91486ad9a23e1 100644 (file)
@@ -94,7 +94,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(exec->callee());
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    ArrayBuffer* arrayBuffer(toArrayBuffer(exec->argument(0)));
+    ArrayBuffer* arrayBuffer = toArrayBuffer(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(arrayBuffer);
@@ -106,7 +106,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(exec->callee());
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    RefPtr<ArrayBufferView> arrayBufferView(toArrayBufferView(exec->argument(0)));
+    RefPtr<ArrayBufferView> arrayBufferView = toArrayBufferView(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(arrayBufferView);
@@ -118,7 +118,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(exec->callee());
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Blob* blob(JSBlob::toWrapped(exec->argument(0)));
+    Blob* blob = JSBlob::toWrapped(exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(blob);
@@ -130,7 +130,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(exec->callee());
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String string(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String string = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(string);
index c2fe0c06fff439f77730cb15bfb187106568166f..465dec2553c8627d6690462b338b02e561024cc9 100644 (file)
@@ -270,7 +270,7 @@ void setJSTestSerializedScriptValueInterfaceValue(ExecState* exec, JSObject* bas
         return;
     }
     auto& impl = castedThis->impl();
-    RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0));
+    RefPtr<SerializedScriptValue> nativeValue = SerializedScriptValue::create(exec, value, 0, 0);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setValue(nativeValue);
@@ -290,7 +290,7 @@ void setJSTestSerializedScriptValueInterfaceCachedValue(ExecState* exec, JSObjec
         return;
     }
     auto& impl = castedThis->impl();
-    RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0));
+    RefPtr<SerializedScriptValue> nativeValue = SerializedScriptValue::create(exec, value, 0, 0);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setCachedValue(nativeValue);
index 29d013c9f62eba37bfb8671da36ab2bee1c1b6de..3f5d0d9a2bd711dc892605ba54ef1091db15acfc 100644 (file)
@@ -149,7 +149,7 @@ EncodedJSValue JSC_HOST_CALL JSTestTypedefsConstructor::constructJSTestTypedefs(
     auto* castedThis = jsCast<JSTestTypedefsConstructor*>(exec->callee());
     if (UNLIKELY(exec->argumentCount() < 2))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    const String hello(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
+    String hello = exec->argument(0).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     if (!exec->argument(1).isFunction())
@@ -385,7 +385,7 @@ void setJSTestTypedefsUnsignedLongLongAttr(ExecState* exec, JSObject* baseObject
         return;
     }
     auto& impl = castedThis->impl();
-    unsigned long long nativeValue(toUInt64(exec, value, NormalConversion));
+    unsigned long long nativeValue = toUInt64(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setUnsignedLongLongAttr(nativeValue);
@@ -405,7 +405,7 @@ void setJSTestTypedefsImmutableSerializedScriptValue(ExecState* exec, JSObject*
         return;
     }
     auto& impl = castedThis->impl();
-    RefPtr<SerializedScriptValue> nativeValue(SerializedScriptValue::create(exec, value, 0, 0));
+    RefPtr<SerializedScriptValue> nativeValue = SerializedScriptValue::create(exec, value, 0, 0);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setImmutableSerializedScriptValue(nativeValue);
@@ -425,7 +425,7 @@ void setJSTestTypedefsAttrWithGetterException(ExecState* exec, JSObject* baseObj
         return;
     }
     auto& impl = castedThis->impl();
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttrWithGetterException(nativeValue);
@@ -446,7 +446,7 @@ void setJSTestTypedefsAttrWithSetterException(ExecState* exec, JSObject* baseObj
     }
     auto& impl = castedThis->impl();
     ExceptionCode ec = 0;
-    int nativeValue(toInt32(exec, value, NormalConversion));
+    int nativeValue = toInt32(exec, value, NormalConversion);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setAttrWithSetterException(nativeValue, ec);
@@ -467,7 +467,7 @@ void setJSTestTypedefsStringAttrWithGetterException(ExecState* exec, JSObject* b
         return;
     }
     auto& impl = castedThis->impl();
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setStringAttrWithGetterException(nativeValue);
@@ -488,7 +488,7 @@ void setJSTestTypedefsStringAttrWithSetterException(ExecState* exec, JSObject* b
     }
     auto& impl = castedThis->impl();
     ExceptionCode ec = 0;
-    const String nativeValue(value.isEmpty() ? String() : value.toString(exec)->value(exec));
+    String nativeValue = value.toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return;
     impl.setStringAttrWithSetterException(nativeValue, ec);
@@ -516,7 +516,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionFunc(ExecState* exec
         return JSValue::encode(jsUndefined());
     }
 
-    Vector<int> x(toNativeArray<int>(exec, exec->argument(0)));
+    Vector<int> x = toNativeArray<int>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.func(x);
@@ -533,13 +533,13 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSetShadow(ExecState*
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 3))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    float width(exec->argument(0).toFloat(exec));
+    float width = exec->argument(0).toFloat(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    float height(exec->argument(1).toFloat(exec));
+    float height = exec->argument(1).toFloat(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
-    float blur(exec->argument(2).toFloat(exec));
+    float blur = exec->argument(2).toFloat(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
 
@@ -549,7 +549,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSetShadow(ExecState*
         return JSValue::encode(jsUndefined());
     }
 
-    const String color(exec->argument(3).isEmpty() ? String() : exec->argument(3).toString(exec)->value(exec));
+    String color = exec->argument(3).toString(exec)->value(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     if (argsCount <= 4) {
@@ -557,7 +557,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionSetShadow(ExecState*
         return JSValue::encode(jsUndefined());
     }
 
-    float alpha(exec->argument(4).toFloat(exec));
+    float alpha = exec->argument(4).toFloat(exec);
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.setShadow(width, height, blur, color, alpha);
@@ -574,7 +574,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithSequenceAr
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<RefPtr<SerializedScriptValue>> sequenceArg((toRefPtrNativeArray<SerializedScriptValue, JSSerializedScriptValue>(exec, exec->argument(0), &JSSerializedScriptValue::toWrapped)));
+    Vector<RefPtr<SerializedScriptValue>> sequenceArg = (toRefPtrNativeArray<SerializedScriptValue, JSSerializedScriptValue>(exec, exec->argument(0), &JSSerializedScriptValue::toWrapped));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsNumber(impl.methodWithSequenceArg(sequenceArg));
@@ -591,7 +591,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionNullableArrayArg(Exe
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<String> arrayArg(toNativeArray<String>(exec, exec->argument(0)));
+    Vector<String> arrayArg = toNativeArray<String>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     impl.nullableArrayArg(arrayArg);
@@ -658,7 +658,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringArrayFunction(
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    Vector<String> values(toNativeArray<String>(exec, exec->argument(0)));
+    Vector<String> values = toNativeArray<String>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsArray(exec, castedThis->globalObject(), impl.stringArrayFunction(values, ec));
@@ -678,7 +678,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionStringArrayFunction2
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
     ExceptionCode ec = 0;
-    Vector<String> values(toNativeArray<String>(exec, exec->argument(0)));
+    Vector<String> values = toNativeArray<String>(exec, exec->argument(0));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsArray(exec, castedThis->globalObject(), impl.stringArrayFunction2(values, ec));
@@ -697,7 +697,7 @@ EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionCallWithSequenceThat
     auto& impl = castedThis->impl();
     if (UNLIKELY(exec->argumentCount() < 1))
         return throwVMError(exec, createNotEnoughArgumentsError(exec));
-    Vector<RefPtr<TestEventTarget>> sequenceArg((toRefPtrNativeArray<TestEventTarget, JSTestEventTarget>(exec, exec->argument(0), &JSTestEventTarget::toWrapped)));
+    Vector<RefPtr<TestEventTarget>> sequenceArg = (toRefPtrNativeArray<TestEventTarget, JSTestEventTarget>(exec, exec->argument(0), &JSTestEventTarget::toWrapped));
     if (UNLIKELY(exec->hadException()))
         return JSValue::encode(jsUndefined());
     JSValue result = jsBoolean(impl.callWithSequenceThatRequiresInclude(sequenceArg));