| Index: Source/bindings/scripts/deprecated_code_generator_v8.pm
|
| diff --git a/Source/bindings/scripts/deprecated_code_generator_v8.pm b/Source/bindings/scripts/deprecated_code_generator_v8.pm
|
| index 1ecc85d12b67a509616814fce5ddaeb4d2a2775b..5f5027103b1ea0e8018446305936fcb5e7db77e3 100644
|
| --- a/Source/bindings/scripts/deprecated_code_generator_v8.pm
|
| +++ b/Source/bindings/scripts/deprecated_code_generator_v8.pm
|
| @@ -2326,11 +2326,19 @@ sub GenerateParametersCheck
|
| $parameterCheckString .= " $parameterName = ${v8ClassName}::create(args[$paramIndex], getScriptExecutionContext());\n";
|
| $parameterCheckString .= " }\n";
|
| } else {
|
| - $parameterCheckString .= " if (args.Length() <= $paramIndex || !args[$paramIndex]->IsFunction()) {\n";
|
| + $parameterCheckString .= " if (args.Length() <= $paramIndex || ";
|
| + if ($parameter->isNullable) {
|
| + $parameterCheckString .= "!(args[$paramIndex]->IsFunction() || args[$paramIndex]->IsNull())";
|
| + } else {
|
| + $parameterCheckString .= "!args[$paramIndex]->IsFunction()";
|
| + }
|
| + $parameterCheckString .= ") {\n";
|
| $parameterCheckString .= " throwTypeError(args.GetIsolate());\n";
|
| $parameterCheckString .= " return;\n";
|
| $parameterCheckString .= " }\n";
|
| - $parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName = ${v8ClassName}::create(args[$paramIndex], getScriptExecutionContext());\n";
|
| + $parameterCheckString .= " RefPtr<" . $parameter->type . "> $parameterName = ";
|
| + $parameterCheckString .= "args[$paramIndex]->IsNull() ? 0 : " if $parameter->isNullable;
|
| + $parameterCheckString .= "${v8ClassName}::create(args[$paramIndex], getScriptExecutionContext());\n";
|
| }
|
| } elsif ($parameter->extendedAttributes->{"Clamp"}) {
|
| my $nativeValue = "${parameterName}NativeValue";
|
|
|