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

Unified Diff: lib/dom/scripts/databasebuilder.py

Issue 10669031: Support V8EnabledAtRuntime in constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | lib/dom/scripts/systemnative.py » ('j') | lib/dom/scripts/systemnative.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/databasebuilder.py
diff --git a/lib/dom/scripts/databasebuilder.py b/lib/dom/scripts/databasebuilder.py
index 6109e6fce694316e6df89359b24fe8d389640e06..d3ed4977be820ac7d20356f26df929bbf612ab65 100755
--- a/lib/dom/scripts/databasebuilder.py
+++ b/lib/dom/scripts/databasebuilder.py
@@ -585,4 +585,19 @@ class DatabaseBuilder(object):
if 'V8EnabledPerContext' in attr.ext_attrs:
interface.ext_attrs['synthesizedV8EnabledPerContext'] = attr.ext_attrs['V8EnabledPerContext']
if 'V8EnabledAtRuntime' in attr.ext_attrs:
- interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = attr.ext_attrs['V8EnabledAtRuntime']
+ def normalize_name(name):
+ # Python variant of WK_lcfirst from
+ # WebKit/Source/WebCore/bindings/scripts/CodeGenerator.pm.
+ def pair(s): return (s, s.lower())
podivilov 2012/06/26 10:51:13 Please move this logic to generation phase. And we
Anton Muhin 2012/06/26 12:16:35 Done.
+ mapping = [
+ pair('hTML'), pair('uRL'), pair('jS'), pair('xML'), pair('xSLT'),
+ ('create', 'isCreate'), ('exclusive', 'isExclusive'),
+ ]
+ name = name[0].lower() + name[1:]
+ for prefix, subst in mapping:
+ if name.startswith(prefix):
+ return subst + name[len(prefix):]
+ return name
+
+ interface.ext_attrs['synthesizedV8EnabledAtRuntime'] = normalize_name(
+ attr.ext_attrs['V8EnabledAtRuntime'] or attr.id)
« no previous file with comments | « no previous file | lib/dom/scripts/systemnative.py » ('j') | lib/dom/scripts/systemnative.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698