Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (206089 => 206090)
--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2016-09-19 07:23:53 UTC (rev 206089)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2016-09-19 09:00:38 UTC (rev 206090)
@@ -356,7 +356,16 @@
struct VariadicHelper : public VariadicHelperBase<JSClass, DOMClass> {
using Item = typename VariadicHelperBase<JSClass, DOMClass>::Item;
using Container = Vector<Item>;
- using Result = typename std::pair<size_t, Optional<Container>>;
+
+ struct Result {
+ Result(size_t argumentIndex, Optional<Container>&& arguments)
+ : argumentIndex(argumentIndex)
+ , arguments(WTFMove(arguments))
+ {
+ }
+ size_t argumentIndex;
+ Optional<Container> arguments;
+ };
};
template<typename VariadicHelper> typename VariadicHelper::Result toArguments(JSC::ExecState&, size_t startIndex = 0);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (206089 => 206090)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-09-19 07:23:53 UTC (rev 206089)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-09-19 09:00:38 UTC (rev 206090)
@@ -4010,10 +4010,10 @@
push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
}
else {
- push(@$outputArray, " if (!$name.second)\n");
- push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $name.first, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"$type\");\n");
+ push(@$outputArray, " if (!$name.arguments)\n");
+ push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $name.argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"$type\");\n");
}
- $value = "WTFMove(*$name.second)";
+ $value = "WTFMove($name.arguments.value())";
} elsif ($codeGenerator->IsEnumType($type)) {
my $className = GetEnumerationClassName($interface, $type);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (206089 => 206090)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-09-19 07:23:53 UTC (rev 206089)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-09-19 09:00:38 UTC (rev 206090)
@@ -6551,9 +6551,9 @@
ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
auto& impl = castedThis->wrapped();
auto blobArgs = toArguments<VariadicHelper<JSBlob, Blob>>(*state, 0);
- if (!blobArgs.second)
- return throwArgumentTypeError(*state, throwScope, blobArgs.first, "blobArgs", "TestObject", "overloadedMethod", "Blob");
- impl.overloadedMethod(WTFMove(*blobArgs.second));
+ if (!blobArgs.arguments)
+ return throwArgumentTypeError(*state, throwScope, blobArgs.argumentIndex, "blobArgs", "TestObject", "overloadedMethod", "Blob");
+ impl.overloadedMethod(WTFMove(blobArgs.arguments.value()));
return JSValue::encode(jsUndefined());
}
@@ -7086,7 +7086,7 @@
auto tail = toArguments<VariadicHelper<JSC::JSValue, String>>(*state, 1);
if (UNLIKELY(throwScope.exception()))
return JSValue::encode(jsUndefined());
- impl.variadicStringMethod(WTFMove(head), WTFMove(*tail.second));
+ impl.variadicStringMethod(WTFMove(head), WTFMove(tail.arguments.value()));
return JSValue::encode(jsUndefined());
}
@@ -7109,7 +7109,7 @@
auto tail = toArguments<VariadicHelper<JSC::JSValue, double>>(*state, 1);
if (UNLIKELY(throwScope.exception()))
return JSValue::encode(jsUndefined());
- impl.variadicDoubleMethod(WTFMove(head), WTFMove(*tail.second));
+ impl.variadicDoubleMethod(WTFMove(head), WTFMove(tail.arguments.value()));
return JSValue::encode(jsUndefined());
}
@@ -7130,9 +7130,9 @@
if (UNLIKELY(!head))
return throwArgumentTypeError(*state, throwScope, 0, "head", "TestObject", "variadicNodeMethod", "Node");
auto tail = toArguments<VariadicHelper<JSNode, Node>>(*state, 1);
- if (!tail.second)
- return throwArgumentTypeError(*state, throwScope, tail.first, "tail", "TestObject", "variadicNodeMethod", "Node");
- impl.variadicNodeMethod(*head, WTFMove(*tail.second));
+ if (!tail.arguments)
+ return throwArgumentTypeError(*state, throwScope, tail.argumentIndex, "tail", "TestObject", "variadicNodeMethod", "Node");
+ impl.variadicNodeMethod(*head, WTFMove(tail.arguments.value()));
return JSValue::encode(jsUndefined());
}