Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 99333017: IDL compiler: simplify type conversion in Event Constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix layout test result (error text) Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..75e03594b4d448d8cc34c1f1c6cc5b382cb245f2 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -3020,29 +3020,8 @@ END
my $attributeName = $attribute->name;
my $attributeImplName = GetImplName($attribute);
- # Construct the arguments to the corresponding Dictionary.convert() method.
- my @convertArguments = ();
- if ($attribute->extendedAttributes->{"EnforceRange"}) {
- push(@convertArguments, "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) . ")";
- }
-
- my $dictionaryGetter = "options.convert(conversionContext${withPropertyAttributes}, \"$attributeName\", eventInit.$attributeImplName)";
+ my $isNullable = $attribute->isNullable ? "true" : "false";
+ my $dictionaryGetter = "options.convert(conversionContext.setConversionType(\"" . $attribute->type . "\", $isNullable), \"$attributeName\", eventInit.$attributeImplName)";
my $deprecation = $attribute->extendedAttributes->{"DeprecateAs"};
if ($deprecation) {
$code .= " if ($dictionaryGetter) {\n";

Powered by Google App Engine
This is Rietveld 408576698