| Index: Source/bindings/scripts/code_generator_v8.pm
|
| diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm
|
| index 75e4ecac855c9c79e4c0948e9fc5c4db3b1bdfd3..9bb654cf472c912adaf6e8d9b1ccb7ad981e7e7b 100644
|
| --- a/Source/bindings/scripts/code_generator_v8.pm
|
| +++ b/Source/bindings/scripts/code_generator_v8.pm
|
| @@ -2699,13 +2699,10 @@ sub GenerateOverloadedConstructorCallback
|
| my $interfaceName = $interface->name;
|
| my $implClassName = GetImplName($interface);
|
|
|
| - my $hasExceptionState = 0;
|
| - my $header = "";
|
| - $header .= <<END;
|
| + my $code .= <<END;
|
| static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| END
|
| - my $code = "";
|
| my $leastNumMandatoryParams = 255;
|
| foreach my $constructor (@{$interface->constructors}) {
|
| my $name = "constructor" . $constructor->overloadedIndex;
|
| @@ -2717,18 +2714,13 @@ END
|
| $code .= " }\n";
|
| }
|
| if ($leastNumMandatoryParams >= 1) {
|
| - if (!$hasExceptionState) {
|
| - $header .= " ExceptionState exceptionState(ExceptionState::ConstructionContext, \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
|
| - $hasExceptionState = 1;
|
| - }
|
| - $code .= " if (UNLIKELY(info.Length() < $leastNumMandatoryParams)) {\n";
|
| - $code .= " exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments($leastNumMandatoryParams, info.Length()));\n";
|
| - $code .= " exceptionState.throwIfNeeded();\n";
|
| - $code .= " return;\n";
|
| - $code .= " }\n";
|
| - }
|
| - if ($hasExceptionState) {
|
| $code .= <<END;
|
| + ExceptionState exceptionState(ExceptionState::ConstructionContext, \"${interfaceName}\", info.Holder(), info.GetIsolate());
|
| + if (UNLIKELY(info.Length() < $leastNumMandatoryParams)) {
|
| + exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments($leastNumMandatoryParams, info.Length()));
|
| + exceptionState.throwIfNeeded();
|
| + return;
|
| + }
|
| exceptionState.throwTypeError(\"No matching constructor signature.\");
|
| exceptionState.throwIfNeeded();
|
| END
|
| @@ -2738,7 +2730,7 @@ END
|
| END
|
| }
|
| $code .= "}\n\n";
|
| - $implementation{nameSpaceInternal}->add($header . $code);
|
| + $implementation{nameSpaceInternal}->add($code);
|
| }
|
|
|
| sub GenerateSingleConstructorCallback
|
|
|