Log Message
_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.
Modified Paths
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp
- trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp
- trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp
- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Diff
Modified: trunk/Source/WebCore/ChangeLog (185372 => 185373)
--- trunk/Source/WebCore/ChangeLog 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/ChangeLog 2015-06-09 19:55:02 UTC (rev 185373)
@@ -1,3 +1,56 @@
+2015-06-09 Darin Adler <[email protected]>
+
+ _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 <[email protected]>
Fix unused private field warning in GraphicsLayerUpdater.h
Modified: trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -43,10 +43,10 @@
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::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);
Modified: trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -43,29 +43,27 @@
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
}
Modified: trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -42,29 +42,27 @@
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
}
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2015-06-09 19:55:02 UTC (rev 185373)
@@ -2638,7 +2638,7 @@
}
}
- 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 @@
$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 @@
}
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 @@
my %nativeType = (
"CompareHow" => "Range::CompareHow",
- "DOMString" => "const String",
+ "DOMString" => "String",
"NodeFilter" => "RefPtr<NodeFilter>",
"SerializedScriptValue" => "RefPtr<SerializedScriptValue>",
"Date" => "double",
@@ -3711,7 +3713,7 @@
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 @@
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 @@
if ($type eq "Dictionary") {
AddToImplIncludes("Dictionary.h", $conditional);
- return "exec, $value";
+ return "{ exec, $value }";
}
if ($type eq "DOMStringList" ) {
@@ -3873,7 +3875,7 @@
}
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
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -214,7 +214,7 @@
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 @@
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -205,7 +205,7 @@
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -243,7 +243,7 @@
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 @@
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));
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -272,10 +272,10 @@
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 @@
{
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 @@
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 @@
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 @@
{
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 @@
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 @@
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 @@
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 @@
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)));
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -128,13 +128,13 @@
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -378,7 +378,7 @@
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 @@
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 @@
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 @@
}
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -1894,7 +1894,7 @@
{
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
{
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 @@
{
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -94,7 +94,7 @@
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 @@
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 @@
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 @@
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -270,7 +270,7 @@
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 @@
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (185372 => 185373)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2015-06-09 19:29:57 UTC (rev 185372)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2015-06-09 19:55:02 UTC (rev 185373)
@@ -149,7 +149,7 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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));
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
