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

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

Issue 20034002: Add support for KeyboardEvent.location attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
Index: Source/bindings/scripts/deprecated_code_generator_v8.pm
diff --git a/Source/bindings/scripts/deprecated_code_generator_v8.pm b/Source/bindings/scripts/deprecated_code_generator_v8.pm
index cd82aff027380ca35809a45ddab051dae33d2e56..40cdd99ca93e64a0bbbdd6ee537e45dea7f26cc1 100644
--- a/Source/bindings/scripts/deprecated_code_generator_v8.pm
+++ b/Source/bindings/scripts/deprecated_code_generator_v8.pm
@@ -2694,11 +2694,26 @@ END
END
}
+ my $declaredFoundBoolean = 0;
foreach my $attribute (@{$interface->attributes}) {
if ($attribute->extendedAttributes->{"InitializedByEventConstructor"}) {
if ($attribute->type ne "any") {
my $attributeName = $attribute->name;
- $code .= " options.get(\"$attributeName\", eventInit.$attributeName);\n";
+ my $attributeImplName = GetImplName($attribute);
+ my $deprecation = $attribute->extendedAttributes->{"DeprecateAs"};
+ $code .= " ";
+ if ($deprecation) {
+ unless ($declaredFoundBoolean) {
+ $code .= "bool ";
+ $declaredFoundBoolean = 1;
+ }
+ $code .= "found = ";
+ }
+ $code .= "options.get(\"$attributeName\", eventInit.$attributeImplName);\n";
+ if ($deprecation) {
+ $code .= " if (found)\n";
+ $code .= " " . GenerateDeprecationNotification($deprecation);
haraken 2013/07/23 09:21:30 How about generating the following code? Then 'fou
do-not-use 2013/07/23 10:12:04 OK. Will do.
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698