| Index: Source/bindings/scripts/v8_interface.py
|
| diff --git a/Source/bindings/scripts/v8_interface.py b/Source/bindings/scripts/v8_interface.py
|
| index db90d4c09eb55a64bbd26bdd3f54021a24b4685f..a6d669d63c0aa4dbca27ed82a8e233358dd41225 100644
|
| --- a/Source/bindings/scripts/v8_interface.py
|
| +++ b/Source/bindings/scripts/v8_interface.py
|
| @@ -250,13 +250,35 @@ def generate_interface(interface):
|
| for method in interface.operations
|
| if method.name] # Skip anonymous special operations (methods)
|
| generate_method_overloads(methods)
|
| +
|
| + per_context_enabled_methods = []
|
| + custom_registration_methods = []
|
| + method_configuration_methods = []
|
| +
|
| for method in methods:
|
| - method['do_generate_method_configuration'] = (
|
| - method['do_not_check_signature'] and
|
| - not method['per_context_enabled_function'] and
|
| - # For overloaded methods, only generate one accessor
|
| - ('overload_index' not in method or method['overload_index'] == 1))
|
| + # Skip all but one method in each set of overloaded methods.
|
| + if 'overload_index' in method and 'overloads' not in method:
|
| + continue
|
| +
|
| + if 'overloads' in method:
|
| + overloads = method['overloads']
|
| + per_context_enabled_function = overloads['per_context_enabled_function_all']
|
| + runtime_enabled_function = overloads['runtime_enabled_function_all']
|
| + needs_custom_registration = overloads['needs_custom_registration_all']
|
| + else:
|
| + per_context_enabled_function = method['per_context_enabled_function']
|
| + runtime_enabled_function = method['runtime_enabled_function']
|
| + needs_custom_registration = method['needs_custom_registration']
|
| +
|
| + if per_context_enabled_function:
|
| + per_context_enabled_methods.append(method)
|
| + continue
|
| + if runtime_enabled_function or needs_custom_registration:
|
| + custom_registration_methods.append(method)
|
| + continue
|
| + method_configuration_methods.append(method)
|
|
|
| + for method in methods:
|
| # The value of the Function object’s “length” property is a Number
|
| # determined as follows:
|
| # 1. Let S be the effective overload set for regular operations (if the
|
| @@ -272,11 +294,12 @@ def generate_interface(interface):
|
| method['number_of_required_arguments'])
|
|
|
| template_contents.update({
|
| + 'custom_registration_methods': custom_registration_methods,
|
| 'has_origin_safe_method_setter': any(
|
| method['is_check_security_for_frame'] and not method['is_read_only']
|
| for method in methods),
|
| - 'has_method_configuration': any(method['do_generate_method_configuration'] for method in methods),
|
| - 'has_per_context_enabled_methods': any(method['per_context_enabled_function'] for method in methods),
|
| + 'method_configuration_methods': method_configuration_methods,
|
| + 'per_context_enabled_methods': per_context_enabled_methods,
|
| 'methods': methods,
|
| })
|
|
|
| @@ -391,6 +414,9 @@ def generate_overloads(overloads):
|
| # entries in S.
|
| 'maxarg': lengths[-1],
|
| 'measure_all_as': common_value(overloads, 'measure_as'), # [MeasureAs]
|
| + 'needs_custom_registration_all': common_value(overloads, 'needs_custom_registration'),
|
| + 'per_context_enabled_function_all': common_value(overloads, 'per_context_enabled_function'), # [PerContextEnabled]
|
| + 'runtime_enabled_function_all': common_value(overloads, 'runtime_enabled_function'), # [RuntimeEnabled]
|
| 'valid_arities': lengths
|
| # Only need to report valid arities if there is a gap in the
|
| # sequence of possible lengths, otherwise invalid length means
|
|
|