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

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

Issue 139293004: Teach the IDL compiler about TreatNullAs=EmptyString (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update test results Created 6 years, 11 months 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
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObject.idl » ('j') | Source/bindings/v8/V8StringResource.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObject.idl » ('j') | Source/bindings/v8/V8StringResource.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698