Chromium Code Reviews| 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 df956b87dff421b022246172e6284f092390125e..7009f1a5c3d99f11a1bf98f6407071f925234e9a 100644 |
| --- a/Source/bindings/scripts/code_generator_v8.pm |
| +++ b/Source/bindings/scripts/code_generator_v8.pm |
| @@ -437,6 +437,8 @@ sub AddIncludesForType |
| } elsif ($type eq "EventHandler") { |
| AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); |
| AddToImplIncludes("bindings/v8/V8EventListenerList.h"); |
| + } elsif ($type eq "Dictionary") { |
| + AddToImplIncludes("bindings/v8/Dictionary.h"); |
| } elsif (IsTypedArrayType($type)) { |
| AddToImplIncludes("bindings/v8/custom/V8${type}Custom.h"); |
| } elsif (my $arrayType = GetArrayType($type)) { |
| @@ -2600,7 +2602,7 @@ END |
| my $default = defined $parameter->extendedAttributes->{"Default"} ? $parameter->extendedAttributes->{"Default"} : ""; |
| my $jsValue = $parameter->isOptional && $default eq "NullString" ? "argumentOrNull(info, $paramIndex)" : "info[$paramIndex]"; |
| my $stringResourceParameterName = $parameterName; |
| - my $isNullable = $parameter->isNullable && !IsRefPtrType($parameter->type); |
| + my $isNullable = IsNullableParameter($parameter); |
| if ($isNullable) { |
| $parameterCheckString .= " bool ${parameterName}IsNull = $jsValue->IsNull();\n"; |
| $stringResourceParameterName .= "StringResource"; |
| @@ -2639,7 +2641,7 @@ END |
| } |
| my $default = defined $parameter->extendedAttributes->{"Default"} ? $parameter->extendedAttributes->{"Default"} : ""; |
| my $jsValue = $parameter->isOptional && $default eq "NullString" ? "argumentOrNull(info, $paramIndex)" : "info[$paramIndex]"; |
| - my $isNullable = $parameter->isNullable && !IsRefPtrType($parameter->type); |
| + my $isNullable = IsNullableParameter($parameter); |
| $parameterCheckString .= " bool ${parameterName}IsNull = $jsValue->IsNull();\n" if $isNullable; |
| $parameterCheckString .= JSValueToNativeStatement($parameter->type, $parameter->extendedAttributes, $humanFriendlyIndex, $jsValue, $parameterName, " ", "info.GetIsolate()"); |
| if ($nativeType eq 'Dictionary' or $nativeType eq 'ScriptPromise') { |
| @@ -5182,7 +5184,7 @@ sub GenerateFunctionCallString |
| END |
| } elsif ($parameter->type eq "SVGMatrix" and $interfaceName eq "SVGTransformList") { |
| push @arguments, "$paramName.get()"; |
| - } elsif ($parameter->isNullable && !IsRefPtrType($parameter->type)) { |
| + } elsif (IsNullableParameter($parameter)) { |
| push @arguments, "${paramName}IsNull ? 0 : &$paramName"; |
| } else { |
| push @arguments, $paramName; |
| @@ -5985,10 +5987,18 @@ sub IsRefPtrType |
| return 0 if IsCallbackFunctionType($type); |
| return 0 if IsEnumType($type); |
| return 0 if IsUnionType($type); |
| + return 0 if $type eq "Dictionary"; |
| return 1; |
| } |
| +sub IsNullableParameter |
| +{ |
| + my $parameter = shift; |
| + |
| + return $parameter->isNullable && !IsRefPtrType($parameter->type) && $parameter->type ne "Dictionary"; |
|
haraken
2013/11/19 11:12:05
You won't need to check '$parameter->type ne "Dict
alancutter (OOO until 2018)
2013/11/19 23:43:47
Without '$parameter->type ne "Dictionary"' it will
|
| +} |
| + |
| sub GetSVGTypeNeedingTearOff |
| { |
| my $type = shift; |