diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py index abffa96b56c47..0d30efb8a30b4 100644 --- a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py +++ b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py @@ -73,13 +73,14 @@ from idl_definitions import Visitor import idl_types from idl_types import IdlType +from v8_attributes import attribute_filters import v8_callback_interface import v8_dictionary from v8_globals import includes, interfaces import v8_interface import v8_types import v8_union -from v8_utilities import capitalize, cpp_name, v8_class_name +from v8_utilities import capitalize, cpp_name, unique_by, v8_class_name from utilities import KNOWN_COMPONENTS, idl_filename_to_component, is_valid_component_dependency, is_testing_target, shorten_union_name @@ -420,7 +421,9 @@ def initialize_jinja_env(cache_dir): 'blink_capitalize': capitalize, 'exposed': exposed_if, 'runtime_enabled': runtime_enabled_if, + 'unique_by': unique_by, }) + jinja_env.filters.update(attribute_filters()) return jinja_env diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py index 2e990ed2e9ed7..d3325ecee79d1 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py @@ -156,6 +156,7 @@ def attribute_context(interface, attribute): 'reflect_missing': extended_attributes.get('ReflectMissing'), 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly'), 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(attribute), # [RuntimeEnabled] + 'runtime_feature_name': v8_utilities.runtime_feature_name(attribute), # [RuntimeEnabled] 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script), 'world_suffixes': ( ['', 'ForMainWorld'] diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py index c448a0ab2ab7a..e73440cc67633 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py @@ -282,25 +282,6 @@ def interface_context(interface): context.update({ 'attributes': attributes, - 'has_accessor_configuration': any( - not (attribute['exposed_test'] or - attribute['runtime_enabled_function']) and - not attribute['is_data_type_property'] and - attribute['should_be_exposed_to_script'] - for attribute in attributes), - 'has_attribute_configuration': any( - not (attribute['exposed_test'] or - attribute['runtime_enabled_function']) and - attribute['is_data_type_property'] and - attribute['should_be_exposed_to_script'] - for attribute in attributes), - 'has_constructor_attributes': any( - attribute['constructor_type'] - for attribute in attributes), - 'has_replaceable_attributes': any( - attribute['is_replaceable'] and - not attribute['is_data_type_property'] - for attribute in attributes), }) # Methods diff --git a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py index 98e1e74a31d24..8c2932615ada7 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py @@ -112,6 +112,17 @@ def uncapitalize(name): return name[0].lower() + name[1:] +def unique_by(dict_list, key): + """Returns elements from a list of dictionaries with unique values for the named key.""" + keys_seen = set() + filtered_list = [] + for item in dict_list: + if item.get(key) not in keys_seen: + filtered_list.append(item) + keys_seen.add(item.get(key)) + return filtered_list + + ################################################################################ # C++ ################################################################################ diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp index b59835a477770..1d13190eb01f7 100644 --- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp +++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp @@ -43,51 +43,47 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local v8Value, {{ } {% endif %} {% for member in members %} - {% if member.runtime_enabled_function %} - if ({{member.runtime_enabled_function}}()) { - {% else %} - { + {% filter runtime_enabled(member.runtime_enabled_function) %} + v8::Local {{member.name}}Value; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}")).ToLocal(&{{member.name}}Value)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined()) { + {% if member.is_required %} + exceptionState.throwTypeError("required member {{member.name}} is undefined."); + return; + {% else %} + // Do nothing. + {% endif %} + {% if member.is_nullable %} + } else if ({{member.name}}Value->IsNull()) { + impl.{{member.null_setter_name}}(); {% endif %} - v8::Local {{member.name}}Value; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}")).ToLocal(&{{member.name}}Value)) { - exceptionState.rethrowV8Exception(block.Exception()); + } else { + {% if member.deprecate_as %} + Deprecation::countDeprecationIfNotPrivateScript(isolate, currentExecutionContext(isolate), UseCounter::{{member.deprecate_as}}); + {% endif %} + {{v8_value_to_local_cpp_value(member) | indent(8)}} + {% if member.is_interface_type %} + if (!{{member.name}} && !{{member.name}}Value->IsNull()) { + exceptionState.throwTypeError("member {{member.name}} is not of type {{member.idl_type}}."); return; } - if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined()) { - {% if member.is_required %} - exceptionState.throwTypeError("required member {{member.name}} is undefined."); - return; - {% else %} - // Do nothing. - {% endif %} - {% if member.is_nullable %} - } else if ({{member.name}}Value->IsNull()) { - impl.{{member.null_setter_name}}(); {% endif %} - } else { - {% if member.deprecate_as %} - Deprecation::countDeprecationIfNotPrivateScript(isolate, currentExecutionContext(isolate), UseCounter::{{member.deprecate_as}}); - {% endif %} - {{v8_value_to_local_cpp_value(member) | indent(12)}} - {% if member.is_interface_type %} - if (!{{member.name}} && !{{member.name}}Value->IsNull()) { - exceptionState.throwTypeError("member {{member.name}} is not of type {{member.idl_type}}."); - return; - } - {% endif %} - {% if member.enum_values %} - {{declare_enum_validation_variable(member.enum_values) | indent(12)}} - if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(validValues), "{{member.enum_type}}", exceptionState)) - return; - {% elif member.is_object %} - if (!{{member.name}}.isObject()) { - exceptionState.throwTypeError("member {{member.name}} is not an object."); - return; - } - {% endif %} - impl.{{member.setter_name}}({{member.name}}); + {% if member.enum_values %} + {{declare_enum_validation_variable(member.enum_values) | indent(8)}} + if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(validValues), "{{member.enum_type}}", exceptionState)) + return; + {% elif member.is_object %} + if (!{{member.name}}.isObject()) { + exceptionState.throwTypeError("member {{member.name}} is not an object."); + return; } + {% endif %} + impl.{{member.setter_name}}({{member.name}}); } + {% endfilter %} {% endfor %} } diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp b/third_party/WebKit/Source/bindings/templates/interface_base.cpp index 274d7c9cfb244..cccec85afdba8 100644 --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp @@ -120,8 +120,7 @@ bool securityCheck(v8::Local accessingContext, v8::Local accessingContext, v8::Local accessingContext, v8::Local accessingContext, v8::LocalSetAccessCheckCallback({{cpp_class}}V8Internal::securityCheck, v8::External::New(isolate, const_cast(&{{v8_class}}::wrapperTypeInfo))); @@ -315,21 +298,9 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo prototypeTemplate->SetIntrinsicDataProperty(v8::Symbol::GetIterator(isolate), v8::kArrayProto_values, v8::DontEnum); {% endif %} - {%- set runtime_enabled_features = dict() %} - {% for attribute in attributes - if attribute.runtime_enabled_function and - not attribute.exposed_test %} - {% if attribute.runtime_enabled_function not in runtime_enabled_features %} - {% set unused = runtime_enabled_features.update({attribute.runtime_enabled_function: []}) %} - {% endif %} - {% set unused = runtime_enabled_features.get(attribute.runtime_enabled_function).append(attribute) %} - {% endfor %} - {% for runtime_enabled_feature in runtime_enabled_features | sort %}{{newline}} - if ({{runtime_enabled_feature}}()) { - {% set distinct_attributes = [] %} - {% for attribute in runtime_enabled_features.get(runtime_enabled_feature) | sort - if attribute.name not in distinct_attributes %} - {% set unused = distinct_attributes.append(attribute.name) %} + {%- for group in attributes | runtime_enabled_attributes | groupby('runtime_feature_name') %}{{newline}} + if ({{group.list[0].runtime_enabled_function}}()) { + {% for attribute in group.list | unique_by('name') | sort %} {% if attribute.is_data_type_property %} const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration = \ {{attribute_configuration(attribute)}}; diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp index 94d0bb88e640a..660836089f99c 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp @@ -41,327 +41,291 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local v8Value exceptionState.rethrowV8Exception(block.Exception()); return; } - { - v8::Local anyMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "anyMember")).ToLocal(&anyMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); - return; - } - if (anyMemberValue.IsEmpty() || anyMemberValue->IsUndefined()) { - // Do nothing. - } else { - ScriptValue anyMember = ScriptValue(ScriptState::current(isolate), anyMemberValue); - impl.setAnyMember(anyMember); - } + v8::Local anyMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "anyMember")).ToLocal(&anyMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (anyMemberValue.IsEmpty() || anyMemberValue->IsUndefined()) { + // Do nothing. + } else { + ScriptValue anyMember = ScriptValue(ScriptState::current(isolate), anyMemberValue); + impl.setAnyMember(anyMember); } - { - v8::Local booleanMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "booleanMember")).ToLocal(&booleanMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local booleanMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "booleanMember")).ToLocal(&booleanMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { + // Do nothing. + } else { + bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptionState); + if (exceptionState.hadException()) return; - } - if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { - // Do nothing. - } else { - bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptionState); - if (exceptionState.hadException()) - return; - impl.setBooleanMember(booleanMember); - } + impl.setBooleanMember(booleanMember); } - { - v8::Local createValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "create")).ToLocal(&createValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local createValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "create")).ToLocal(&createValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (createValue.IsEmpty() || createValue->IsUndefined()) { + // Do nothing. + } else { + bool create = toBoolean(isolate, createValue, exceptionState); + if (exceptionState.hadException()) return; - } - if (createValue.IsEmpty() || createValue->IsUndefined()) { - // Do nothing. - } else { - bool create = toBoolean(isolate, createValue, exceptionState); - if (exceptionState.hadException()) - return; - impl.setCreateMember(create); - } + impl.setCreateMember(create); } - { - v8::Local deprecatedCreateMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "deprecatedCreateMember")).ToLocal(&deprecatedCreateMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local deprecatedCreateMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "deprecatedCreateMember")).ToLocal(&deprecatedCreateMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (deprecatedCreateMemberValue.IsEmpty() || deprecatedCreateMemberValue->IsUndefined()) { + // Do nothing. + } else { + Deprecation::countDeprecationIfNotPrivateScript(isolate, currentExecutionContext(isolate), UseCounter::CreateMember); + bool deprecatedCreateMember = toBoolean(isolate, deprecatedCreateMemberValue, exceptionState); + if (exceptionState.hadException()) return; - } - if (deprecatedCreateMemberValue.IsEmpty() || deprecatedCreateMemberValue->IsUndefined()) { - // Do nothing. - } else { - Deprecation::countDeprecationIfNotPrivateScript(isolate, currentExecutionContext(isolate), UseCounter::CreateMember); - bool deprecatedCreateMember = toBoolean(isolate, deprecatedCreateMemberValue, exceptionState); - if (exceptionState.hadException()) - return; - impl.setCreateMember(deprecatedCreateMember); - } + impl.setCreateMember(deprecatedCreateMember); } - { - v8::Local dictionaryMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "dictionaryMember")).ToLocal(&dictionaryMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local dictionaryMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "dictionaryMember")).ToLocal(&dictionaryMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (dictionaryMemberValue.IsEmpty() || dictionaryMemberValue->IsUndefined()) { + // Do nothing. + } else { + Dictionary dictionaryMember = Dictionary(dictionaryMemberValue, isolate, exceptionState); + if (exceptionState.hadException()) + return; + if (!dictionaryMember.isObject()) { + exceptionState.throwTypeError("member dictionaryMember is not an object."); return; } - if (dictionaryMemberValue.IsEmpty() || dictionaryMemberValue->IsUndefined()) { - // Do nothing. - } else { - Dictionary dictionaryMember = Dictionary(dictionaryMemberValue, isolate, exceptionState); - if (exceptionState.hadException()) - return; - if (!dictionaryMember.isObject()) { - exceptionState.throwTypeError("member dictionaryMember is not an object."); - return; - } - impl.setDictionaryMember(dictionaryMember); - } + impl.setDictionaryMember(dictionaryMember); } - { - v8::Local doubleOrNullMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doubleOrNullMember")).ToLocal(&doubleOrNullMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local doubleOrNullMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doubleOrNullMember")).ToLocal(&doubleOrNullMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUndefined()) { + // Do nothing. + } else if (doubleOrNullMemberValue->IsNull()) { + impl.setDoubleOrNullMemberToNull(); + } else { + double doubleOrNullMember = toRestrictedDouble(isolate, doubleOrNullMemberValue, exceptionState); + if (exceptionState.hadException()) return; - } - if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUndefined()) { - // Do nothing. - } else if (doubleOrNullMemberValue->IsNull()) { - impl.setDoubleOrNullMemberToNull(); - } else { - double doubleOrNullMember = toRestrictedDouble(isolate, doubleOrNullMemberValue, exceptionState); - if (exceptionState.hadException()) - return; - impl.setDoubleOrNullMember(doubleOrNullMember); - } + impl.setDoubleOrNullMember(doubleOrNullMember); } - { - v8::Local doubleOrStringMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doubleOrStringMember")).ToLocal(&doubleOrStringMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local doubleOrStringMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doubleOrStringMember")).ToLocal(&doubleOrStringMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (doubleOrStringMemberValue.IsEmpty() || doubleOrStringMemberValue->IsUndefined()) { + // Do nothing. + } else { + DoubleOrString doubleOrStringMember; + V8DoubleOrString::toImpl(isolate, doubleOrStringMemberValue, doubleOrStringMember, UnionTypeConversionMode::NotNullable, exceptionState); + if (exceptionState.hadException()) return; - } - if (doubleOrStringMemberValue.IsEmpty() || doubleOrStringMemberValue->IsUndefined()) { - // Do nothing. - } else { - DoubleOrString doubleOrStringMember; - V8DoubleOrString::toImpl(isolate, doubleOrStringMemberValue, doubleOrStringMember, UnionTypeConversionMode::NotNullable, exceptionState); - if (exceptionState.hadException()) - return; - impl.setDoubleOrStringMember(doubleOrStringMember); - } + impl.setDoubleOrStringMember(doubleOrStringMember); } - { - v8::Local doubleOrStringSequenceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doubleOrStringSequenceMember")).ToLocal(&doubleOrStringSequenceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local doubleOrStringSequenceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doubleOrStringSequenceMember")).ToLocal(&doubleOrStringSequenceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (doubleOrStringSequenceMemberValue.IsEmpty() || doubleOrStringSequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + HeapVector doubleOrStringSequenceMember = toImplArray>(doubleOrStringSequenceMemberValue, 0, isolate, exceptionState); + if (exceptionState.hadException()) return; - } - if (doubleOrStringSequenceMemberValue.IsEmpty() || doubleOrStringSequenceMemberValue->IsUndefined()) { - // Do nothing. - } else { - HeapVector doubleOrStringSequenceMember = toImplArray>(doubleOrStringSequenceMemberValue, 0, isolate, exceptionState); - if (exceptionState.hadException()) - return; - impl.setDoubleOrStringSequenceMember(doubleOrStringSequenceMember); - } + impl.setDoubleOrStringSequenceMember(doubleOrStringSequenceMember); } - { - v8::Local elementOrNullMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "elementOrNullMember")).ToLocal(&elementOrNullMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local elementOrNullMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "elementOrNullMember")).ToLocal(&elementOrNullMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (elementOrNullMemberValue.IsEmpty() || elementOrNullMemberValue->IsUndefined()) { + // Do nothing. + } else if (elementOrNullMemberValue->IsNull()) { + impl.setElementOrNullMemberToNull(); + } else { + Element* elementOrNullMember = V8Element::toImplWithTypeCheck(isolate, elementOrNullMemberValue); + if (!elementOrNullMember && !elementOrNullMemberValue->IsNull()) { + exceptionState.throwTypeError("member elementOrNullMember is not of type Element."); return; } - if (elementOrNullMemberValue.IsEmpty() || elementOrNullMemberValue->IsUndefined()) { - // Do nothing. - } else if (elementOrNullMemberValue->IsNull()) { - impl.setElementOrNullMemberToNull(); - } else { - Element* elementOrNullMember = V8Element::toImplWithTypeCheck(isolate, elementOrNullMemberValue); - if (!elementOrNullMember && !elementOrNullMemberValue->IsNull()) { - exceptionState.throwTypeError("member elementOrNullMember is not of type Element."); - return; - } - impl.setElementOrNullMember(elementOrNullMember); - } + impl.setElementOrNullMember(elementOrNullMember); } - { - v8::Local enumMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "enumMember")).ToLocal(&enumMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local enumMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "enumMember")).ToLocal(&enumMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (enumMemberValue.IsEmpty() || enumMemberValue->IsUndefined()) { + // Do nothing. + } else { + V8StringResource<> enumMember = enumMemberValue; + if (!enumMember.prepare(exceptionState)) return; - } - if (enumMemberValue.IsEmpty() || enumMemberValue->IsUndefined()) { - // Do nothing. - } else { - V8StringResource<> enumMember = enumMemberValue; - if (!enumMember.prepare(exceptionState)) - return; - const char* validValues[] = { - "", - "EnumValue1", - "EnumValue2", - "EnumValue3", - }; - if (!isValidEnum(enumMember, validValues, WTF_ARRAY_LENGTH(validValues), "TestEnum", exceptionState)) - return; - impl.setEnumMember(enumMember); - } + const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(enumMember, validValues, WTF_ARRAY_LENGTH(validValues), "TestEnum", exceptionState)) + return; + impl.setEnumMember(enumMember); } - { - v8::Local enumSequenceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "enumSequenceMember")).ToLocal(&enumSequenceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local enumSequenceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "enumSequenceMember")).ToLocal(&enumSequenceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (enumSequenceMemberValue.IsEmpty() || enumSequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + Vector enumSequenceMember = toImplArray>(enumSequenceMemberValue, 0, isolate, exceptionState); + if (exceptionState.hadException()) return; - } - if (enumSequenceMemberValue.IsEmpty() || enumSequenceMemberValue->IsUndefined()) { - // Do nothing. - } else { - Vector enumSequenceMember = toImplArray>(enumSequenceMemberValue, 0, isolate, exceptionState); - if (exceptionState.hadException()) - return; - const char* validValues[] = { - "", - "EnumValue1", - "EnumValue2", - "EnumValue3", - }; - if (!isValidEnum(enumSequenceMember, validValues, WTF_ARRAY_LENGTH(validValues), "TestEnum", exceptionState)) - return; - impl.setEnumSequenceMember(enumSequenceMember); - } + const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(enumSequenceMember, validValues, WTF_ARRAY_LENGTH(validValues), "TestEnum", exceptionState)) + return; + impl.setEnumSequenceMember(enumSequenceMember); } - { - v8::Local eventTargetMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "eventTargetMember")).ToLocal(&eventTargetMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local eventTargetMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "eventTargetMember")).ToLocal(&eventTargetMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (eventTargetMemberValue.IsEmpty() || eventTargetMemberValue->IsUndefined()) { + // Do nothing. + } else { + EventTarget* eventTargetMember = toEventTarget(isolate, eventTargetMemberValue); + if (!eventTargetMember && !eventTargetMemberValue->IsNull()) { + exceptionState.throwTypeError("member eventTargetMember is not of type EventTarget."); return; } - if (eventTargetMemberValue.IsEmpty() || eventTargetMemberValue->IsUndefined()) { - // Do nothing. - } else { - EventTarget* eventTargetMember = toEventTarget(isolate, eventTargetMemberValue); - if (!eventTargetMember && !eventTargetMemberValue->IsNull()) { - exceptionState.throwTypeError("member eventTargetMember is not of type EventTarget."); - return; - } - impl.setEventTargetMember(eventTargetMember); - } + impl.setEventTargetMember(eventTargetMember); } - { - v8::Local internalDictionarySequenceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "internalDictionarySequenceMember")).ToLocal(&internalDictionarySequenceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local internalDictionarySequenceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "internalDictionarySequenceMember")).ToLocal(&internalDictionarySequenceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (internalDictionarySequenceMemberValue.IsEmpty() || internalDictionarySequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + HeapVector internalDictionarySequenceMember = toImplArray>(internalDictionarySequenceMemberValue, 0, isolate, exceptionState); + if (exceptionState.hadException()) return; - } - if (internalDictionarySequenceMemberValue.IsEmpty() || internalDictionarySequenceMemberValue->IsUndefined()) { - // Do nothing. - } else { - HeapVector internalDictionarySequenceMember = toImplArray>(internalDictionarySequenceMemberValue, 0, isolate, exceptionState); - if (exceptionState.hadException()) - return; - impl.setInternalDictionarySequenceMember(internalDictionarySequenceMember); - } + impl.setInternalDictionarySequenceMember(internalDictionarySequenceMember); } - { - v8::Local longMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "longMember")).ToLocal(&longMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local longMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "longMember")).ToLocal(&longMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (longMemberValue.IsEmpty() || longMemberValue->IsUndefined()) { + // Do nothing. + } else { + int longMember = toInt32(isolate, longMemberValue, NormalConversion, exceptionState); + if (exceptionState.hadException()) return; - } - if (longMemberValue.IsEmpty() || longMemberValue->IsUndefined()) { - // Do nothing. - } else { - int longMember = toInt32(isolate, longMemberValue, NormalConversion, exceptionState); - if (exceptionState.hadException()) - return; - impl.setLongMember(longMember); - } + impl.setLongMember(longMember); } - { - v8::Local objectMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "objectMember")).ToLocal(&objectMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local objectMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "objectMember")).ToLocal(&objectMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (objectMemberValue.IsEmpty() || objectMemberValue->IsUndefined()) { + // Do nothing. + } else { + ScriptValue objectMember = ScriptValue(ScriptState::current(isolate), objectMemberValue); + if (!objectMember.isObject()) { + exceptionState.throwTypeError("member objectMember is not an object."); return; } - if (objectMemberValue.IsEmpty() || objectMemberValue->IsUndefined()) { - // Do nothing. - } else { - ScriptValue objectMember = ScriptValue(ScriptState::current(isolate), objectMemberValue); - if (!objectMember.isObject()) { - exceptionState.throwTypeError("member objectMember is not an object."); - return; - } - impl.setObjectMember(objectMember); - } + impl.setObjectMember(objectMember); } - { - v8::Local objectOrNullMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "objectOrNullMember")).ToLocal(&objectOrNullMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local objectOrNullMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "objectOrNullMember")).ToLocal(&objectOrNullMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (objectOrNullMemberValue.IsEmpty() || objectOrNullMemberValue->IsUndefined()) { + // Do nothing. + } else if (objectOrNullMemberValue->IsNull()) { + impl.setObjectOrNullMemberToNull(); + } else { + ScriptValue objectOrNullMember = ScriptValue(ScriptState::current(isolate), objectOrNullMemberValue); + if (!objectOrNullMember.isObject()) { + exceptionState.throwTypeError("member objectOrNullMember is not an object."); return; } - if (objectOrNullMemberValue.IsEmpty() || objectOrNullMemberValue->IsUndefined()) { - // Do nothing. - } else if (objectOrNullMemberValue->IsNull()) { - impl.setObjectOrNullMemberToNull(); - } else { - ScriptValue objectOrNullMember = ScriptValue(ScriptState::current(isolate), objectOrNullMemberValue); - if (!objectOrNullMember.isObject()) { - exceptionState.throwTypeError("member objectOrNullMember is not an object."); - return; - } - impl.setObjectOrNullMember(objectOrNullMember); - } + impl.setObjectOrNullMember(objectOrNullMember); } - { - v8::Local otherDoubleOrStringMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "otherDoubleOrStringMember")).ToLocal(&otherDoubleOrStringMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local otherDoubleOrStringMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "otherDoubleOrStringMember")).ToLocal(&otherDoubleOrStringMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (otherDoubleOrStringMemberValue.IsEmpty() || otherDoubleOrStringMemberValue->IsUndefined()) { + // Do nothing. + } else { + DoubleOrString otherDoubleOrStringMember; + V8DoubleOrString::toImpl(isolate, otherDoubleOrStringMemberValue, otherDoubleOrStringMember, UnionTypeConversionMode::NotNullable, exceptionState); + if (exceptionState.hadException()) return; - } - if (otherDoubleOrStringMemberValue.IsEmpty() || otherDoubleOrStringMemberValue->IsUndefined()) { - // Do nothing. - } else { - DoubleOrString otherDoubleOrStringMember; - V8DoubleOrString::toImpl(isolate, otherDoubleOrStringMemberValue, otherDoubleOrStringMember, UnionTypeConversionMode::NotNullable, exceptionState); - if (exceptionState.hadException()) - return; - impl.setOtherDoubleOrStringMember(otherDoubleOrStringMember); - } + impl.setOtherDoubleOrStringMember(otherDoubleOrStringMember); } - { - v8::Local restrictedDoubleMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "restrictedDoubleMember")).ToLocal(&restrictedDoubleMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local restrictedDoubleMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "restrictedDoubleMember")).ToLocal(&restrictedDoubleMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (restrictedDoubleMemberValue.IsEmpty() || restrictedDoubleMemberValue->IsUndefined()) { + // Do nothing. + } else { + double restrictedDoubleMember = toRestrictedDouble(isolate, restrictedDoubleMemberValue, exceptionState); + if (exceptionState.hadException()) return; - } - if (restrictedDoubleMemberValue.IsEmpty() || restrictedDoubleMemberValue->IsUndefined()) { - // Do nothing. - } else { - double restrictedDoubleMember = toRestrictedDouble(isolate, restrictedDoubleMemberValue, exceptionState); - if (exceptionState.hadException()) - return; - impl.setRestrictedDoubleMember(restrictedDoubleMember); - } + impl.setRestrictedDoubleMember(restrictedDoubleMember); } if (RuntimeEnabledFeatures::runtimeFeatureEnabled()) { @@ -380,229 +344,203 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local v8Value } } - { - v8::Local stringArrayMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringArrayMember")).ToLocal(&stringArrayMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local stringArrayMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringArrayMember")).ToLocal(&stringArrayMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (stringArrayMemberValue.IsEmpty() || stringArrayMemberValue->IsUndefined()) { + // Do nothing. + } else { + Vector stringArrayMember = toImplArray>(stringArrayMemberValue, 0, isolate, exceptionState); + if (exceptionState.hadException()) return; - } - if (stringArrayMemberValue.IsEmpty() || stringArrayMemberValue->IsUndefined()) { - // Do nothing. - } else { - Vector stringArrayMember = toImplArray>(stringArrayMemberValue, 0, isolate, exceptionState); - if (exceptionState.hadException()) - return; - impl.setStringArrayMember(stringArrayMember); - } + impl.setStringArrayMember(stringArrayMember); } - { - v8::Local stringMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringMember")).ToLocal(&stringMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local stringMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringMember")).ToLocal(&stringMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) { + // Do nothing. + } else { + V8StringResource<> stringMember = stringMemberValue; + if (!stringMember.prepare(exceptionState)) return; - } - if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) { - // Do nothing. - } else { - V8StringResource<> stringMember = stringMemberValue; - if (!stringMember.prepare(exceptionState)) - return; - impl.setStringMember(stringMember); - } + impl.setStringMember(stringMember); } - { - v8::Local stringOrNullMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringOrNullMember")).ToLocal(&stringOrNullMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local stringOrNullMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringOrNullMember")).ToLocal(&stringOrNullMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (stringOrNullMemberValue.IsEmpty() || stringOrNullMemberValue->IsUndefined()) { + // Do nothing. + } else if (stringOrNullMemberValue->IsNull()) { + impl.setStringOrNullMemberToNull(); + } else { + V8StringResource<> stringOrNullMember = stringOrNullMemberValue; + if (!stringOrNullMember.prepare(exceptionState)) return; - } - if (stringOrNullMemberValue.IsEmpty() || stringOrNullMemberValue->IsUndefined()) { - // Do nothing. - } else if (stringOrNullMemberValue->IsNull()) { - impl.setStringOrNullMemberToNull(); - } else { - V8StringResource<> stringOrNullMember = stringOrNullMemberValue; - if (!stringOrNullMember.prepare(exceptionState)) - return; - impl.setStringOrNullMember(stringOrNullMember); - } + impl.setStringOrNullMember(stringOrNullMember); } - { - v8::Local stringSequenceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringSequenceMember")).ToLocal(&stringSequenceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local stringSequenceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringSequenceMember")).ToLocal(&stringSequenceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (stringSequenceMemberValue.IsEmpty() || stringSequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + Vector stringSequenceMember = toImplArray>(stringSequenceMemberValue, 0, isolate, exceptionState); + if (exceptionState.hadException()) return; - } - if (stringSequenceMemberValue.IsEmpty() || stringSequenceMemberValue->IsUndefined()) { - // Do nothing. - } else { - Vector stringSequenceMember = toImplArray>(stringSequenceMemberValue, 0, isolate, exceptionState); - if (exceptionState.hadException()) - return; - impl.setStringSequenceMember(stringSequenceMember); - } + impl.setStringSequenceMember(stringSequenceMember); } - { - v8::Local testInterface2OrUint8ArrayMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterface2OrUint8ArrayMember")).ToLocal(&testInterface2OrUint8ArrayMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local testInterface2OrUint8ArrayMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterface2OrUint8ArrayMember")).ToLocal(&testInterface2OrUint8ArrayMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (testInterface2OrUint8ArrayMemberValue.IsEmpty() || testInterface2OrUint8ArrayMemberValue->IsUndefined()) { + // Do nothing. + } else { + TestInterface2OrUint8Array testInterface2OrUint8ArrayMember; + V8TestInterface2OrUint8Array::toImpl(isolate, testInterface2OrUint8ArrayMemberValue, testInterface2OrUint8ArrayMember, UnionTypeConversionMode::NotNullable, exceptionState); + if (exceptionState.hadException()) return; - } - if (testInterface2OrUint8ArrayMemberValue.IsEmpty() || testInterface2OrUint8ArrayMemberValue->IsUndefined()) { - // Do nothing. - } else { - TestInterface2OrUint8Array testInterface2OrUint8ArrayMember; - V8TestInterface2OrUint8Array::toImpl(isolate, testInterface2OrUint8ArrayMemberValue, testInterface2OrUint8ArrayMember, UnionTypeConversionMode::NotNullable, exceptionState); - if (exceptionState.hadException()) - return; - impl.setTestInterface2OrUint8ArrayMember(testInterface2OrUint8ArrayMember); - } + impl.setTestInterface2OrUint8ArrayMember(testInterface2OrUint8ArrayMember); } - { - v8::Local testInterfaceGarbageCollectedMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceGarbageCollectedMember")).ToLocal(&testInterfaceGarbageCollectedMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local testInterfaceGarbageCollectedMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceGarbageCollectedMember")).ToLocal(&testInterfaceGarbageCollectedMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (testInterfaceGarbageCollectedMemberValue.IsEmpty() || testInterfaceGarbageCollectedMemberValue->IsUndefined()) { + // Do nothing. + } else { + TestInterfaceGarbageCollected* testInterfaceGarbageCollectedMember = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceGarbageCollectedMemberValue); + if (!testInterfaceGarbageCollectedMember && !testInterfaceGarbageCollectedMemberValue->IsNull()) { + exceptionState.throwTypeError("member testInterfaceGarbageCollectedMember is not of type TestInterfaceGarbageCollected."); return; } - if (testInterfaceGarbageCollectedMemberValue.IsEmpty() || testInterfaceGarbageCollectedMemberValue->IsUndefined()) { - // Do nothing. - } else { - TestInterfaceGarbageCollected* testInterfaceGarbageCollectedMember = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceGarbageCollectedMemberValue); - if (!testInterfaceGarbageCollectedMember && !testInterfaceGarbageCollectedMemberValue->IsNull()) { - exceptionState.throwTypeError("member testInterfaceGarbageCollectedMember is not of type TestInterfaceGarbageCollected."); - return; - } - impl.setTestInterfaceGarbageCollectedMember(testInterfaceGarbageCollectedMember); - } + impl.setTestInterfaceGarbageCollectedMember(testInterfaceGarbageCollectedMember); } - { - v8::Local testInterfaceGarbageCollectedOrNullMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceGarbageCollectedOrNullMember")).ToLocal(&testInterfaceGarbageCollectedOrNullMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local testInterfaceGarbageCollectedOrNullMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceGarbageCollectedOrNullMember")).ToLocal(&testInterfaceGarbageCollectedOrNullMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (testInterfaceGarbageCollectedOrNullMemberValue.IsEmpty() || testInterfaceGarbageCollectedOrNullMemberValue->IsUndefined()) { + // Do nothing. + } else if (testInterfaceGarbageCollectedOrNullMemberValue->IsNull()) { + impl.setTestInterfaceGarbageCollectedOrNullMemberToNull(); + } else { + TestInterfaceGarbageCollected* testInterfaceGarbageCollectedOrNullMember = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceGarbageCollectedOrNullMemberValue); + if (!testInterfaceGarbageCollectedOrNullMember && !testInterfaceGarbageCollectedOrNullMemberValue->IsNull()) { + exceptionState.throwTypeError("member testInterfaceGarbageCollectedOrNullMember is not of type TestInterfaceGarbageCollected."); return; } - if (testInterfaceGarbageCollectedOrNullMemberValue.IsEmpty() || testInterfaceGarbageCollectedOrNullMemberValue->IsUndefined()) { - // Do nothing. - } else if (testInterfaceGarbageCollectedOrNullMemberValue->IsNull()) { - impl.setTestInterfaceGarbageCollectedOrNullMemberToNull(); - } else { - TestInterfaceGarbageCollected* testInterfaceGarbageCollectedOrNullMember = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(isolate, testInterfaceGarbageCollectedOrNullMemberValue); - if (!testInterfaceGarbageCollectedOrNullMember && !testInterfaceGarbageCollectedOrNullMemberValue->IsNull()) { - exceptionState.throwTypeError("member testInterfaceGarbageCollectedOrNullMember is not of type TestInterfaceGarbageCollected."); - return; - } - impl.setTestInterfaceGarbageCollectedOrNullMember(testInterfaceGarbageCollectedOrNullMember); - } + impl.setTestInterfaceGarbageCollectedOrNullMember(testInterfaceGarbageCollectedOrNullMember); } - { - v8::Local testInterfaceGarbageCollectedSequenceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceGarbageCollectedSequenceMember")).ToLocal(&testInterfaceGarbageCollectedSequenceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local testInterfaceGarbageCollectedSequenceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceGarbageCollectedSequenceMember")).ToLocal(&testInterfaceGarbageCollectedSequenceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (testInterfaceGarbageCollectedSequenceMemberValue.IsEmpty() || testInterfaceGarbageCollectedSequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + HeapVector> testInterfaceGarbageCollectedSequenceMember = (toMemberNativeArray(testInterfaceGarbageCollectedSequenceMemberValue, 0, isolate, exceptionState)); + if (exceptionState.hadException()) return; - } - if (testInterfaceGarbageCollectedSequenceMemberValue.IsEmpty() || testInterfaceGarbageCollectedSequenceMemberValue->IsUndefined()) { - // Do nothing. - } else { - HeapVector> testInterfaceGarbageCollectedSequenceMember = (toMemberNativeArray(testInterfaceGarbageCollectedSequenceMemberValue, 0, isolate, exceptionState)); - if (exceptionState.hadException()) - return; - impl.setTestInterfaceGarbageCollectedSequenceMember(testInterfaceGarbageCollectedSequenceMember); - } + impl.setTestInterfaceGarbageCollectedSequenceMember(testInterfaceGarbageCollectedSequenceMember); } - { - v8::Local testInterfaceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceMember")).ToLocal(&testInterfaceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local testInterfaceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceMember")).ToLocal(&testInterfaceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (testInterfaceMemberValue.IsEmpty() || testInterfaceMemberValue->IsUndefined()) { + // Do nothing. + } else { + TestInterfaceImplementation* testInterfaceMember = V8TestInterface::toImplWithTypeCheck(isolate, testInterfaceMemberValue); + if (!testInterfaceMember && !testInterfaceMemberValue->IsNull()) { + exceptionState.throwTypeError("member testInterfaceMember is not of type TestInterface."); return; } - if (testInterfaceMemberValue.IsEmpty() || testInterfaceMemberValue->IsUndefined()) { - // Do nothing. - } else { - TestInterfaceImplementation* testInterfaceMember = V8TestInterface::toImplWithTypeCheck(isolate, testInterfaceMemberValue); - if (!testInterfaceMember && !testInterfaceMemberValue->IsNull()) { - exceptionState.throwTypeError("member testInterfaceMember is not of type TestInterface."); - return; - } - impl.setTestInterfaceMember(testInterfaceMember); - } + impl.setTestInterfaceMember(testInterfaceMember); } - { - v8::Local testInterfaceOrNullMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceOrNullMember")).ToLocal(&testInterfaceOrNullMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local testInterfaceOrNullMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceOrNullMember")).ToLocal(&testInterfaceOrNullMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (testInterfaceOrNullMemberValue.IsEmpty() || testInterfaceOrNullMemberValue->IsUndefined()) { + // Do nothing. + } else if (testInterfaceOrNullMemberValue->IsNull()) { + impl.setTestInterfaceOrNullMemberToNull(); + } else { + TestInterfaceImplementation* testInterfaceOrNullMember = V8TestInterface::toImplWithTypeCheck(isolate, testInterfaceOrNullMemberValue); + if (!testInterfaceOrNullMember && !testInterfaceOrNullMemberValue->IsNull()) { + exceptionState.throwTypeError("member testInterfaceOrNullMember is not of type TestInterface."); return; } - if (testInterfaceOrNullMemberValue.IsEmpty() || testInterfaceOrNullMemberValue->IsUndefined()) { - // Do nothing. - } else if (testInterfaceOrNullMemberValue->IsNull()) { - impl.setTestInterfaceOrNullMemberToNull(); - } else { - TestInterfaceImplementation* testInterfaceOrNullMember = V8TestInterface::toImplWithTypeCheck(isolate, testInterfaceOrNullMemberValue); - if (!testInterfaceOrNullMember && !testInterfaceOrNullMemberValue->IsNull()) { - exceptionState.throwTypeError("member testInterfaceOrNullMember is not of type TestInterface."); - return; - } - impl.setTestInterfaceOrNullMember(testInterfaceOrNullMember); - } + impl.setTestInterfaceOrNullMember(testInterfaceOrNullMember); } - { - v8::Local testInterfaceSequenceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceSequenceMember")).ToLocal(&testInterfaceSequenceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local testInterfaceSequenceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "testInterfaceSequenceMember")).ToLocal(&testInterfaceSequenceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (testInterfaceSequenceMemberValue.IsEmpty() || testInterfaceSequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + HeapVector> testInterfaceSequenceMember = (toMemberNativeArray(testInterfaceSequenceMemberValue, 0, isolate, exceptionState)); + if (exceptionState.hadException()) return; - } - if (testInterfaceSequenceMemberValue.IsEmpty() || testInterfaceSequenceMemberValue->IsUndefined()) { - // Do nothing. - } else { - HeapVector> testInterfaceSequenceMember = (toMemberNativeArray(testInterfaceSequenceMemberValue, 0, isolate, exceptionState)); - if (exceptionState.hadException()) - return; - impl.setTestInterfaceSequenceMember(testInterfaceSequenceMember); - } + impl.setTestInterfaceSequenceMember(testInterfaceSequenceMember); } - { - v8::Local uint8ArrayMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "uint8ArrayMember")).ToLocal(&uint8ArrayMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local uint8ArrayMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "uint8ArrayMember")).ToLocal(&uint8ArrayMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (uint8ArrayMemberValue.IsEmpty() || uint8ArrayMemberValue->IsUndefined()) { + // Do nothing. + } else { + DOMUint8Array* uint8ArrayMember = uint8ArrayMemberValue->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local::Cast(uint8ArrayMemberValue)) : 0; + if (!uint8ArrayMember && !uint8ArrayMemberValue->IsNull()) { + exceptionState.throwTypeError("member uint8ArrayMember is not of type Uint8Array."); return; } - if (uint8ArrayMemberValue.IsEmpty() || uint8ArrayMemberValue->IsUndefined()) { - // Do nothing. - } else { - DOMUint8Array* uint8ArrayMember = uint8ArrayMemberValue->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local::Cast(uint8ArrayMemberValue)) : 0; - if (!uint8ArrayMember && !uint8ArrayMemberValue->IsNull()) { - exceptionState.throwTypeError("member uint8ArrayMember is not of type Uint8Array."); - return; - } - impl.setUint8ArrayMember(uint8ArrayMember); - } + impl.setUint8ArrayMember(uint8ArrayMember); } - { - v8::Local unrestrictedDoubleMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "unrestrictedDoubleMember")).ToLocal(&unrestrictedDoubleMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local unrestrictedDoubleMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "unrestrictedDoubleMember")).ToLocal(&unrestrictedDoubleMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (unrestrictedDoubleMemberValue.IsEmpty() || unrestrictedDoubleMemberValue->IsUndefined()) { + // Do nothing. + } else { + double unrestrictedDoubleMember = toDouble(isolate, unrestrictedDoubleMemberValue, exceptionState); + if (exceptionState.hadException()) return; - } - if (unrestrictedDoubleMemberValue.IsEmpty() || unrestrictedDoubleMemberValue->IsUndefined()) { - // Do nothing. - } else { - double unrestrictedDoubleMember = toDouble(isolate, unrestrictedDoubleMemberValue, exceptionState); - if (exceptionState.hadException()) - return; - impl.setUnrestrictedDoubleMember(unrestrictedDoubleMember); - } + impl.setUnrestrictedDoubleMember(unrestrictedDoubleMember); } } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp index ac571d8ca8e05..5abbbd99d0e42 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp @@ -32,69 +32,61 @@ void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Loca exceptionState.rethrowV8Exception(block.Exception()); return; } - { - v8::Local derivedStringMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMember")).ToLocal(&derivedStringMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local derivedStringMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMember")).ToLocal(&derivedStringMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefined()) { + // Do nothing. + } else { + V8StringResource<> derivedStringMember = derivedStringMemberValue; + if (!derivedStringMember.prepare(exceptionState)) return; - } - if (derivedStringMemberValue.IsEmpty() || derivedStringMemberValue->IsUndefined()) { - // Do nothing. - } else { - V8StringResource<> derivedStringMember = derivedStringMemberValue; - if (!derivedStringMember.prepare(exceptionState)) - return; - impl.setDerivedStringMember(derivedStringMember); - } + impl.setDerivedStringMember(derivedStringMember); } - { - v8::Local derivedStringMemberWithDefaultValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMemberWithDefault")).ToLocal(&derivedStringMemberWithDefaultValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local derivedStringMemberWithDefaultValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "derivedStringMemberWithDefault")).ToLocal(&derivedStringMemberWithDefaultValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWithDefaultValue->IsUndefined()) { + // Do nothing. + } else { + V8StringResource<> derivedStringMemberWithDefault = derivedStringMemberWithDefaultValue; + if (!derivedStringMemberWithDefault.prepare(exceptionState)) return; - } - if (derivedStringMemberWithDefaultValue.IsEmpty() || derivedStringMemberWithDefaultValue->IsUndefined()) { - // Do nothing. - } else { - V8StringResource<> derivedStringMemberWithDefault = derivedStringMemberWithDefaultValue; - if (!derivedStringMemberWithDefault.prepare(exceptionState)) - return; - impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault); - } + impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault); } - { - v8::Local requiredLongMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "requiredLongMember")).ToLocal(&requiredLongMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); - return; - } - if (requiredLongMemberValue.IsEmpty() || requiredLongMemberValue->IsUndefined()) { - exceptionState.throwTypeError("required member requiredLongMember is undefined."); + v8::Local requiredLongMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "requiredLongMember")).ToLocal(&requiredLongMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (requiredLongMemberValue.IsEmpty() || requiredLongMemberValue->IsUndefined()) { + exceptionState.throwTypeError("required member requiredLongMember is undefined."); + return; + } else { + int requiredLongMember = toInt32(isolate, requiredLongMemberValue, NormalConversion, exceptionState); + if (exceptionState.hadException()) return; - } else { - int requiredLongMember = toInt32(isolate, requiredLongMemberValue, NormalConversion, exceptionState); - if (exceptionState.hadException()) - return; - impl.setRequiredLongMember(requiredLongMember); - } + impl.setRequiredLongMember(requiredLongMember); } - { - v8::Local stringOrDoubleSequenceMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringOrDoubleSequenceMember")).ToLocal(&stringOrDoubleSequenceMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local stringOrDoubleSequenceMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringOrDoubleSequenceMember")).ToLocal(&stringOrDoubleSequenceMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (stringOrDoubleSequenceMemberValue.IsEmpty() || stringOrDoubleSequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + HeapVector stringOrDoubleSequenceMember = toImplArray>(stringOrDoubleSequenceMemberValue, 0, isolate, exceptionState); + if (exceptionState.hadException()) return; - } - if (stringOrDoubleSequenceMemberValue.IsEmpty() || stringOrDoubleSequenceMemberValue->IsUndefined()) { - // Do nothing. - } else { - HeapVector stringOrDoubleSequenceMember = toImplArray>(stringOrDoubleSequenceMemberValue, 0, isolate, exceptionState); - if (exceptionState.hadException()) - return; - impl.setStringOrDoubleSequenceMember(stringOrDoubleSequenceMember); - } + impl.setStringOrDoubleSequenceMember(stringOrDoubleSequenceMember); } } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp index aca14c68a795a..ae467578ce965 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp @@ -2080,7 +2080,7 @@ void V8TestInterface::installV8TestInterfaceTemplate(v8::Isolate* isolate, const V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, prototypeTemplate, V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttributes)); V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterfaceAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceAccessors)); V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods)); - } // if (RuntimeEnabledFeatures::featureNameEnabled()) + } if (RuntimeEnabledFeatures::featureNameEnabled()) { const V8DOMConfiguration::AccessorConfiguration accessorconditionalReadOnlyLongAttributeConfiguration = \ diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp index 8a94ba9e364a0..14443d05878d6 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp @@ -380,7 +380,6 @@ static void installV8TestInterfaceConstructorTemplate(v8::Isolate* isolate, cons v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceConstructor::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp index c4e195afec377..ad8ae103c7828 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp @@ -232,7 +232,6 @@ static void installV8TestInterfaceConstructor2Template(v8::Isolate* isolate, con v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceConstructor2::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp index 8c02311f9b4a6..204b6b9b87fad 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp @@ -82,7 +82,6 @@ static void installV8TestInterfaceConstructor3Template(v8::Isolate* isolate, con v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceConstructor3::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp index 82a5a4f9759f1..dd9cf06a6ecf0 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp @@ -119,7 +119,6 @@ static void installV8TestInterfaceConstructor4Template(v8::Isolate* isolate, con v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceConstructor4::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp index 2de51ef829a53..26fe25a64d855 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp @@ -64,7 +64,6 @@ static void installV8TestInterfaceCustomConstructorTemplate(v8::Isolate* isolate v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceCustomConstructor::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp index 7ffd59b6d69c3..cddf3bc9297db 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp @@ -46,7 +46,6 @@ static void installV8TestInterfaceEmptyTemplate(v8::Isolate* isolate, const DOMW v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceEmpty::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp index 6b14867610f7f..fda4cf4fbabec 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInit.cpp @@ -31,20 +31,18 @@ void V8TestInterfaceEventInit::toImpl(v8::Isolate* isolate, v8::Local exceptionState.rethrowV8Exception(block.Exception()); return; } - { - v8::Local stringMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringMember")).ToLocal(&stringMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local stringMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "stringMember")).ToLocal(&stringMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) { + // Do nothing. + } else { + V8StringResource<> stringMember = stringMemberValue; + if (!stringMember.prepare(exceptionState)) return; - } - if (stringMemberValue.IsEmpty() || stringMemberValue->IsUndefined()) { - // Do nothing. - } else { - V8StringResource<> stringMember = stringMemberValue; - if (!stringMember.prepare(exceptionState)) - return; - impl.setStringMember(stringMember); - } + impl.setStringMember(stringMember); } } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp index 51557a6db178c..bd0b9b58fa4b6 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp @@ -93,7 +93,6 @@ static void installV8TestInterfaceEventTargetTemplate(v8::Isolate* isolate, cons v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceEventTarget::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp index f9670fed29aee..7595bf4b619d0 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp @@ -102,7 +102,6 @@ static void installV8TestInterfaceNamedConstructor2Template(v8::Isolate* isolate v8::Local prototypeTemplate = interfaceTemplate->PrototypeTemplate(); ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - } v8::Local V8TestInterfaceNamedConstructor2::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp index 45e8fe1e6e0a6..acc0b08e45e04 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.cpp @@ -26,20 +26,18 @@ void V8TestPermissiveDictionary::toImpl(v8::Isolate* isolate, v8::Local booleanMemberValue; - if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "booleanMember")).ToLocal(&booleanMemberValue)) { - exceptionState.rethrowV8Exception(block.Exception()); + v8::Local booleanMemberValue; + if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "booleanMember")).ToLocal(&booleanMemberValue)) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { + // Do nothing. + } else { + bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptionState); + if (exceptionState.hadException()) return; - } - if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { - // Do nothing. - } else { - bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptionState); - if (exceptionState.hadException()) - return; - impl.setBooleanMember(booleanMember); - } + impl.setBooleanMember(booleanMember); } } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp index 389791b118a96..80c1ffd4b4c28 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp @@ -79,7 +79,6 @@ static void installV8TestSpecialOperationsNotEnumerableTemplate(v8::Isolate* iso ALLOW_UNUSED_LOCAL(prototypeTemplate); // Register DOM constants, attributes and operations. - // Indexed properties v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestSpecialOperationsNotEnumerableV8Internal::indexedPropertyGetterCallback, 0, 0, 0, 0, v8::Local(), v8::PropertyHandlerFlags::kNone); instanceTemplate->SetHandler(indexedPropertyHandlerConfig); diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp index 7b6d1761440cb..c5329899803aa 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp @@ -848,7 +848,7 @@ static void installV8TestInterface5Template(v8::Isolate* isolate, const DOMWrapp V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, prototypeTemplate, V8TestInterface5Attributes, WTF_ARRAY_LENGTH(V8TestInterface5Attributes)); V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_ARRAY_LENGTH(V8TestInterface5Accessors)); V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY_LENGTH(V8TestInterface5Methods)); - } // if (RuntimeEnabledFeatures::featureNameEnabled()) + } // Indexed properties v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInterface5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5ImplementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5ImplementationV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator, v8::Local(), v8::PropertyHandlerFlags::kNone); diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp index 210977f202b32..5b66507dcb08f 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp @@ -309,7 +309,7 @@ void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Isolate* isolate }; V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototypeTemplate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants)); V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods)); - } // if (RuntimeEnabledFeatures::featureNameEnabled()) + } } void V8TestInterfacePartial::preparePrototypeAndInterfaceObject(v8::Local context, const DOMWrapperWorld& world, v8::Local prototypeObject, v8::Local interfaceObject, v8::Local interfaceTemplate)