| Index: Source/bindings/scripts/code_generator_v8.py
|
| diff --git a/Source/bindings/scripts/code_generator_v8.py b/Source/bindings/scripts/code_generator_v8.py
|
| index 272b611c34fa69196540cdcf73c0a8ab0a1a0b36..96db1d847470209808935713efd4bec0fccf2673 100644
|
| --- a/Source/bindings/scripts/code_generator_v8.py
|
| +++ b/Source/bindings/scripts/code_generator_v8.py
|
| @@ -239,19 +239,9 @@
|
| jinja_env.filters.update({
|
| 'blink_capitalize': capitalize,
|
| 'conditional': conditional_if_endif,
|
| - 'exposed': exposed_if,
|
| - 'per_context_enabled': per_context_enabled_if,
|
| 'runtime_enabled': runtime_enabled_if,
|
| })
|
| return jinja_env
|
| -
|
| -
|
| -def generate_indented_conditional(code, conditional):
|
| - # Indent if statement to level of original code
|
| - indent = re.match(' *', code).group(0)
|
| - return ('%sif (%s) {\n' % (indent, conditional) +
|
| - ' %s\n' % '\n '.join(code.splitlines()) +
|
| - '%s}\n' % indent)
|
|
|
|
|
| # [Conditional]
|
| @@ -264,25 +254,15 @@
|
| '#endif // %s\n' % conditional_string)
|
|
|
|
|
| -# [Exposed]
|
| -def exposed_if(code, exposed_test):
|
| - if not exposed_test:
|
| - return code
|
| - return generate_indented_conditional(code, 'context && (%s)' % exposed_test)
|
| -
|
| -
|
| -# [PerContextEnabled]
|
| -def per_context_enabled_if(code, per_context_enabled_function):
|
| - if not per_context_enabled_function:
|
| - return code
|
| - return generate_indented_conditional(code, 'context && context->isDocument() && %s(toDocument(context))' % per_context_enabled_function)
|
| -
|
| -
|
| # [RuntimeEnabled]
|
| def runtime_enabled_if(code, runtime_enabled_function_name):
|
| if not runtime_enabled_function_name:
|
| return code
|
| - return generate_indented_conditional(code, '%s()' % runtime_enabled_function_name)
|
| + # Indent if statement to level of original code
|
| + indent = re.match(' *', code).group(0)
|
| + return ('%sif (%s()) {\n' % (indent, runtime_enabled_function_name) +
|
| + ' %s\n' % '\n '.join(code.splitlines()) +
|
| + '%s}\n' % indent)
|
|
|
|
|
| ################################################################################
|
|
|