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 5bef342f2839bc2cfb3128e98b5f799acfeb9377..e4d9e2bd49094fbba2313dd7776a510d1ebe205c 100644 |
| --- a/Source/bindings/scripts/code_generator_v8.pm |
| +++ b/Source/bindings/scripts/code_generator_v8.pm |
| @@ -3020,29 +3020,16 @@ END |
| my $attributeName = $attribute->name; |
| my $attributeImplName = GetImplName($attribute); |
| - # Construct the arguments to the corresponding Dictionary.convert() method. |
| - my @convertArguments = (); |
| + my $isNullable = $attribute->isNullable ? "true" : "false"; |
| + my $numberConversion; |
|
Nils Barth (inactive)
2013/12/11 08:14:20
This is actually never used -- it's always NormalC
|
| if ($attribute->extendedAttributes->{"EnforceRange"}) { |
| - push(@convertArguments, "EnforceRange"); |
| + $numberConversion = "EnforceRange"; |
| } elsif ($attribute->extendedAttributes->{"Clamp"}) { |
| - push(@convertArguments, "Clamp"); |
| - } elsif (IsIntegerType($attribute->type)) { |
| - push(@convertArguments, "NormalConversion"); |
| - } elsif ($attribute->type eq "boolean" || $attribute->type eq "double") { |
| - ; |
| - } elsif ($attribute->type eq "DOMString" || IsEnumType($attribute->type) || IsCallbackFunctionType($attribute->type)) { |
| - ; |
| - } elsif ($attribute->type ne "object") { |
| - push(@convertArguments, "\"" . $attribute->type . "\""); |
| - } |
| - |
| - my $withPropertyAttributes = ""; |
| - if (@convertArguments || $attribute->isNullable) { |
| - unshift(@convertArguments, $attribute->isNullable ? "true" : "false"); |
| - $withPropertyAttributes = ".withAttributes(" . join(", ", @convertArguments) . ")"; |
| + $numberConversion = "Clamp"; |
| + } else { |
| + $numberConversion = "NormalConversion"; |
| } |
| - |
| - my $dictionaryGetter = "options.convert(conversionContext${withPropertyAttributes}, \"$attributeName\", eventInit.$attributeImplName)"; |
| + my $dictionaryGetter = "options.convert(conversionContext.conversionType($isNullable, $numberConversion, \"" . $attribute->type . "\"), \"$attributeName\", eventInit.$attributeImplName)"; |
| my $deprecation = $attribute->extendedAttributes->{"DeprecateAs"}; |
| if ($deprecation) { |
| $code .= " if ($dictionaryGetter) {\n"; |