| Index: third_party/WebKit/Source/bindings/scripts/v8_interface.py
|
| diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
|
| index 1c577d5d14e7e46d68c823a3d082ca73ebf3780e..6f6901392d4538cb41b636a93a5a2e5195c500bc 100644
|
| --- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py
|
| +++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py
|
| @@ -589,6 +589,18 @@ def interface_context(interface):
|
| return context
|
|
|
|
|
| +def reflected_name(constant_name):
|
| + """Returns the name to use for the matching constant name in blink code.
|
| +
|
| + Given an all-uppercase 'CONSTANT_NAME', returns a camel-case
|
| + 'kConstantName'.
|
| + """
|
| + # Check for SHOUTY_CASE constants
|
| + if constant_name.upper() != constant_name:
|
| + return constant_name
|
| + return 'k' + ''.join(part.title() for part in constant_name.split('_'))
|
| +
|
| +
|
| # [DeprecateAs], [OriginTrialEnabled], [Reflect], [RuntimeEnabled]
|
| def constant_context(constant, interface):
|
| extended_attributes = constant.extended_attributes
|
| @@ -602,7 +614,7 @@ def constant_context(constant, interface):
|
| 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(constant), # [OriginTrialEnabled]
|
| 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(constant), # [OriginTrialEnabled]
|
| # FIXME: use 'reflected_name' as correct 'name'
|
| - 'reflected_name': extended_attributes.get('Reflect', constant.name),
|
| + 'reflected_name': extended_attributes.get('Reflect', reflected_name(constant.name)),
|
| 'runtime_enabled_function': runtime_enabled_function_name(constant), # [RuntimeEnabled]
|
| 'runtime_feature_name': v8_utilities.runtime_feature_name(constant), # [RuntimeEnabled]
|
| 'value': constant.value,
|
|
|