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 c43bd0e9913b97bd716117aab63f9d58627fe754..ce9b0c6f0c525906cf7f8d2cbc8439f5e4018cb8 100644 |
| --- a/Source/bindings/scripts/code_generator_v8.pm |
| +++ b/Source/bindings/scripts/code_generator_v8.pm |
| @@ -1840,9 +1840,15 @@ END |
| # Generate super-compact call for regular attribute setter: |
| my $contentAttributeName = $reflect eq "VALUE_IS_MISSING" ? lc $attrName : $reflect; |
| my $namespace = NamespaceForAttributeName($interfaceName, $contentAttributeName); |
| + my $mode = ""; |
|
arv (Not doing code reviews)
2013/10/09 14:55:19
Can this be extracted to a function.
sub GetStrin
Inactive
2013/10/09 15:17:41
Done.
|
| + if (($attribute->extendedAttributes->{"TreatNullAs"} and $attribute->extendedAttributes->{"TreatNullAs"} eq "NullString") and ($attribute->extendedAttributes->{"TreatUndefinedAs"} and $attribute->extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) { |
| + $mode = "WithUndefinedOrNullCheck"; |
| + } elsif ($attribute->extendedAttributes->{"TreatNullAs"} and $attribute->extendedAttributes->{"TreatNullAs"} eq "NullString") { |
| + $mode = "WithNullCheck"; |
| + } |
| AddToImplIncludes("${namespace}.h"); |
| $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; |
| - $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, stringResource, value);\n"; |
| + $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<$mode>, stringResource, value);\n"; |
| # Attr (not Attribute) used in content attributes |
| $code .= " imp->setAttribute(${namespace}::${contentAttributeName}Attr, stringResource);\n"; |
| $code .= "}\n\n"; |
| @@ -5140,7 +5146,7 @@ sub GetNativeType |
| my $mode = ""; |
| if (($extendedAttributes->{"TreatNullAs"} and $extendedAttributes->{"TreatNullAs"} eq "NullString") and ($extendedAttributes->{"TreatUndefinedAs"} and $extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) { |
| $mode = "WithUndefinedOrNullCheck"; |
| - } elsif (($extendedAttributes->{"TreatNullAs"} and $extendedAttributes->{"TreatNullAs"} eq "NullString") or $extendedAttributes->{"Reflect"}) { |
| + } elsif ($extendedAttributes->{"TreatNullAs"} and $extendedAttributes->{"TreatNullAs"} eq "NullString") { |
| $mode = "WithNullCheck"; |
| } |
| # FIXME: Add the case for 'elsif ($attributeOrParameter->extendedAttributes->{"TreatUndefinedAs"} and $attributeOrParameter->extendedAttributes->{"TreatUndefinedAs"} eq "NullString"))'. |