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

Unified Diff: Source/bindings/scripts/unstable/v8_utilities.py

Issue 27638002: IDL compiler: Basic setters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix ; Created 7 years, 2 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 | « Source/bindings/scripts/unstable/v8_types.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/unstable/v8_utilities.py
diff --git a/Source/bindings/scripts/unstable/v8_utilities.py b/Source/bindings/scripts/unstable/v8_utilities.py
index 9b72ab2ac8c2d72d24135a1641e44c97667851a4..93f99e6e89471643ca05a2d30016b082f98b3479 100644
--- a/Source/bindings/scripts/unstable/v8_utilities.py
+++ b/Source/bindings/scripts/unstable/v8_utilities.py
@@ -52,6 +52,23 @@ def has_extended_attribute_value(extended_attributes, key, value):
value in re.split('[|&]', extended_attributes[key]))
+def capitalize(name):
+ """Capitalize first letter or initial acronym (* with some exceptions).
+
+ Used in setter names.
+ """
+ name = name[0].upper() + name[1:]
+ # xmlEncoding becomes XMLEncoding, but xmlllang becomes Xmllang.
+ # FIXME: Remove these special cases
+ if name.startswith('CssText') or re.match('Xml[a-z]', name):
+ return name
+ for acronym in ACRONYMS:
+ if name.startswith(acronym.capitalize()):
+ name.replace(acronym.capitalize(), acronym)
+ return name
+ return name
+
+
def uncapitalize(name):
"""Uncapitalizes first letter or initial acronym (* with some exceptions).
« no previous file with comments | « Source/bindings/scripts/unstable/v8_types.py ('k') | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698