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 949a2262119f32bb250e87c8a1dc740f64289c6e..79272de3041e0b001bfe13f596aa894e9151df57 100644 |
--- a/Source/bindings/scripts/code_generator_v8.pm |
+++ b/Source/bindings/scripts/code_generator_v8.pm |
@@ -676,12 +676,13 @@ sub GetV8StringResourceMode |
{ |
my $extendedAttributes = shift; |
- # Blink uses the non-standard identifier NullString instead of Web IDL |
- # standard EmptyString, in [TreatNullAs=NullString] and [TreatUndefinedAs=NullString], |
- # and does not support [TreatUndefinedAs=Null] or [TreatUndefinedAs=Missing] |
+ # In addition to [TreatNullAs=EmptyString], Blink also supports the non-standard |
+ # [TreatNullAs=NullString] and formerly-standard [TreatUndefinedAs=NullString]. |
# https://sites.google.com/a/chromium.org/dev/blink/webidl/blink-idl-extended-attributes#TOC-TreatNullAs-a-p-TreatUndefinedAs-a-p- |
my $mode = ""; |
- if (($extendedAttributes->{"TreatNullAs"} and $extendedAttributes->{"TreatNullAs"} eq "NullString") and ($extendedAttributes->{"TreatUndefinedAs"} and $extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) { |
+ if ($extendedAttributes->{"TreatNullAs"} and $extendedAttributes->{"TreatNullAs"} eq "EmptyString") { |
+ $mode = "TreatNullAsEmptyString"; |
+ } elsif (($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") { |
$mode = "WithNullCheck"; |