from v8_globals import includes, interfaces
import v8_types
import v8_utilities
-from v8_utilities import capitalize, cpp_name, has_extended_attribute, has_extended_attribute_value, scoped_name, strip_suffix, uncapitalize
+from v8_utilities import (capitalize, cpp_name, has_extended_attribute,
+ has_extended_attribute_value, scoped_name, strip_suffix,
+ uncapitalize, extended_attribute_value_as_list)
def attribute_context(interface, attribute):
is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attributes
is_reflect = 'Reflect' in extended_attributes
if is_custom_element_callbacks or is_reflect:
- includes.add('core/dom/custom/CustomElementCallbackDispatcher.h')
+ includes.add('core/dom/custom/CustomElementProcessingStack.h')
# [PerWorldBindings]
if 'PerWorldBindings' in extended_attributes:
assert idl_type.is_wrapper_type or 'LogActivity' in extended_attributes, '[PerWorldBindings] should only be used with wrapper types: %s.%s' % (interface.name, attribute.name)
'access_control_list': access_control_list(attribute),
'activity_logging_world_list_for_getter': v8_utilities.activity_logging_world_list(attribute, 'Getter'), # [ActivityLogging]
'activity_logging_world_list_for_setter': v8_utilities.activity_logging_world_list(attribute, 'Setter'), # [ActivityLogging]
- 'activity_logging_include_old_value_for_setter': 'LogPreviousValue' in extended_attributes, # [ActivityLogging]
'activity_logging_world_check': v8_utilities.activity_logging_world_check(attribute), # [ActivityLogging]
'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
'cached_attribute_validation_method': extended_attributes.get('CachedAttribute'),
'reflect_empty': extended_attributes.get('ReflectEmpty'),
'reflect_invalid': extended_attributes.get('ReflectInvalid', ''),
'reflect_missing': extended_attributes.get('ReflectMissing'),
- 'reflect_only': extended_attributes['ReflectOnly'].split('|')
- if 'ReflectOnly' in extended_attributes else None,
+ 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly'),
'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(attribute), # [RuntimeEnabled]
'setter_callback': setter_callback_name(interface, attribute),
'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
release = False
if 'ImplementedInPrivateScript' in extended_attributes:
if (not idl_type.is_wrapper_type and
- not idl_type.is_basic_type):
+ not idl_type.is_basic_type and
+ not idl_type.is_enum):
raise Exception('Private scripts supports only primitive types and DOM wrappers.')
context['cpp_value_original'] = cpp_value
elif (idl_type.is_explicit_nullable or
base_idl_type == 'EventHandler' or
'CachedAttribute' in extended_attributes or
- 'LogPreviousValue' in extended_attributes or
'ReflectOnly' in extended_attributes or
context['is_keep_alive_for_gc'] or
context['is_getter_raises_exception']):
'has_setter_exception_state':
is_setter_raises_exception or has_type_checking_interface or
context['has_type_checking_unrestricted'] or
- idl_type.may_raise_exception_on_conversion,
+ idl_type.v8_conversion_needs_exception_state,
'has_type_checking_interface': has_type_checking_interface,
'is_setter_call_with_execution_context': v8_utilities.has_extended_attribute_value(
attribute, 'SetterCallWith', 'ExecutionContext'),