Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (207497 => 207498)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-10-18 23:18:20 UTC (rev 207497)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-10-18 23:18:55 UTC (rev 207498)
@@ -459,7 +459,7 @@
return "\"high\", \"kinda-low\"";
}
-template<> Optional<TestObj::Dictionary> convertDictionary<TestObj::Dictionary>(ExecState& state, JSValue value)
+template<> TestObj::Dictionary convertDictionary<TestObj::Dictionary>(ExecState& state, JSValue value)
{
VM& vm = state.vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -467,228 +467,227 @@
auto* object = isNullOrUndefined ? nullptr : value.getObject();
if (UNLIKELY(!isNullOrUndefined && !object)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
if (UNLIKELY(object && object->type() == RegExpObjectType)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
TestObj::Dictionary result;
JSValue anyTypedefValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyTypedefValue"));
if (!anyTypedefValueValue.isUndefined()) {
result.anyTypedefValue = convert<IDLAny>(state, anyTypedefValueValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.anyTypedefValue = jsUndefined();
JSValue anyValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValue"));
if (!anyValueValue.isUndefined()) {
result.anyValue = convert<IDLAny>(state, anyValueValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.anyValue = jsUndefined();
JSValue anyValueWithNullDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValueWithNullDefault"));
if (!anyValueWithNullDefaultValue.isUndefined()) {
result.anyValueWithNullDefault = convert<IDLAny>(state, anyValueWithNullDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.anyValueWithNullDefault = jsNull();
JSValue booleanWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithDefault"));
if (!booleanWithDefaultValue.isUndefined()) {
result.booleanWithDefault = convert<IDLBoolean>(state, booleanWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.booleanWithDefault = false;
JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
if (!booleanWithoutDefaultValue.isUndefined()) {
result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue bufferSourceValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bufferSourceValue"));
if (!bufferSourceValueValue.isUndefined()) {
result.bufferSourceValue = convert<IDLBufferSource>(state, bufferSourceValueValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "dictionaryMember"));
if (!dictionaryMemberValue.isUndefined()) {
- auto dictionaryMemberOptional = convert<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, dictionaryMemberValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
- result.dictionaryMember = dictionaryMemberOptional.value();
+ result.dictionaryMember = convert<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, dictionaryMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue enumerationValueWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithDefault"));
if (!enumerationValueWithDefaultValue.isUndefined()) {
result.enumerationValueWithDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.enumerationValueWithDefault = TestObj::EnumType::EnumValue1;
JSValue enumerationValueWithEmptyStringDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithEmptyStringDefault"));
if (!enumerationValueWithEmptyStringDefaultValue.isUndefined()) {
result.enumerationValueWithEmptyStringDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithEmptyStringDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.enumerationValueWithEmptyStringDefault = TestObj::EnumType::EmptyString;
JSValue enumerationValueWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithoutDefault"));
if (!enumerationValueWithoutDefaultValue.isUndefined()) {
result.enumerationValueWithoutDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithoutDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue integerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integer"));
if (!integerValue.isUndefined()) {
result.integer = convert<IDLLong>(state, integerValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integerWithDefault"));
if (!integerWithDefaultValue.isUndefined()) {
result.integerWithDefault = convert<IDLLong>(state, integerWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.integerWithDefault = 0;
JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeInteger"));
if (!largeIntegerValue.isUndefined()) {
result.largeInteger = convert<IDLLongLong>(state, largeIntegerValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault"));
if (!largeIntegerWithDefaultValue.isUndefined()) {
result.largeIntegerWithDefault = convert<IDLLongLong>(state, largeIntegerWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.largeIntegerWithDefault = 0;
JSValue nullableIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableIntegerWithDefault"));
if (!nullableIntegerWithDefaultValue.isUndefined()) {
result.nullableIntegerWithDefault = convert<IDLNullable<IDLLong>>(state, nullableIntegerWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.nullableIntegerWithDefault = Nullopt;
JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableNode"));
if (!nullableNodeValue.isUndefined()) {
result.nullableNode = convert<IDLNullable<IDLInterface<Node>>>(state, nullableNodeValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.nullableNode = nullptr;
JSValue nullableStringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableStringWithDefault"));
if (!nullableStringWithDefaultValue.isUndefined()) {
result.nullableStringWithDefault = convert<IDLNullable<IDLDOMString>>(state, nullableStringWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.nullableStringWithDefault = String();
JSValue nullableUnionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableUnionMember"));
if (!nullableUnionMemberValue.isUndefined()) {
result.nullableUnionMember = convert<IDLNullable<IDLUnion<IDLLong, IDLInterface<Node>>>>(state, nullableUnionMemberValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.nullableUnionMember = Nullopt;
JSValue restrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDouble"));
if (!restrictedDoubleValue.isUndefined()) {
result.restrictedDouble = convert<IDLDouble>(state, restrictedDoubleValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue restrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDoubleWithDefault"));
if (!restrictedDoubleWithDefaultValue.isUndefined()) {
result.restrictedDoubleWithDefault = convert<IDLDouble>(state, restrictedDoubleWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.restrictedDoubleWithDefault = 0;
JSValue restrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloat"));
if (!restrictedFloatValue.isUndefined()) {
result.restrictedFloat = convert<IDLFloat>(state, restrictedFloatValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue restrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloatWithDefault"));
if (!restrictedFloatWithDefaultValue.isUndefined()) {
result.restrictedFloatWithDefault = convert<IDLFloat>(state, restrictedFloatWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.restrictedFloatWithDefault = 0;
JSValue sequenceOfStringsValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "sequenceOfStrings"));
if (!sequenceOfStringsValue.isUndefined()) {
result.sequenceOfStrings = convert<IDLSequence<IDLDOMString>>(state, sequenceOfStringsValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue smallIntegerClampedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerClamped"));
if (!smallIntegerClampedValue.isUndefined()) {
result.smallIntegerClamped = convert<IDLByte>(state, smallIntegerClampedValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue smallIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault"));
if (!smallIntegerWithDefaultValue.isUndefined()) {
result.smallIntegerWithDefault = convert<IDLByte>(state, smallIntegerWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue smallUnsignedIntegerEnforcedRangeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange"));
if (!smallUnsignedIntegerEnforcedRangeValue.isUndefined()) {
result.smallUnsignedIntegerEnforcedRange = convert<IDLOctet>(state, smallUnsignedIntegerEnforcedRangeValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue smallUnsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault"));
if (!smallUnsignedIntegerWithDefaultValue.isUndefined()) {
result.smallUnsignedIntegerWithDefault = convert<IDLOctet>(state, smallUnsignedIntegerWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.smallUnsignedIntegerWithDefault = 0;
JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithDefault"));
if (!stringWithDefaultValue.isUndefined()) {
result.stringWithDefault = convert<IDLDOMString>(state, stringWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.stringWithDefault = "defaultString";
JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
if (!stringWithoutDefaultValue.isUndefined()) {
result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue unionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unionMember"));
if (!unionMemberValue.isUndefined()) {
result.unionMember = convert<IDLUnion<IDLLong, IDLInterface<Node>>>(state, unionMemberValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue unrestrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDouble"));
if (!unrestrictedDoubleValue.isUndefined()) {
result.unrestrictedDouble = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue unrestrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDoubleWithDefault"));
if (!unrestrictedDoubleWithDefaultValue.isUndefined()) {
result.unrestrictedDoubleWithDefault = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.unrestrictedDoubleWithDefault = 0;
JSValue unrestrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloat"));
if (!unrestrictedFloatValue.isUndefined()) {
result.unrestrictedFloat = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue unrestrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloatWithDefault"));
if (!unrestrictedFloatWithDefaultValue.isUndefined()) {
result.unrestrictedFloatWithDefault = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.unrestrictedFloatWithDefault = 0;
JSValue unsignedIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedInteger"));
if (!unsignedIntegerValue.isUndefined()) {
result.unsignedInteger = convert<IDLUnsignedLong>(state, unsignedIntegerValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue unsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault"));
if (!unsignedIntegerWithDefaultValue.isUndefined()) {
result.unsignedIntegerWithDefault = convert<IDLUnsignedLong>(state, unsignedIntegerWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.unsignedIntegerWithDefault = 0;
JSValue unsignedLargeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger"));
if (!unsignedLargeIntegerValue.isUndefined()) {
result.unsignedLargeInteger = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue unsignedLargeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault"));
if (!unsignedLargeIntegerWithDefaultValue.isUndefined()) {
result.unsignedLargeIntegerWithDefault = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerWithDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else
result.unsignedLargeIntegerWithDefault = 0;
- return WTFMove(result);
+ return result;
}
-template<> Optional<TestObj::DictionaryThatShouldNotTolerateNull> convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>(ExecState& state, JSValue value)
+template<> TestObj::DictionaryThatShouldNotTolerateNull convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>(ExecState& state, JSValue value)
{
VM& vm = state.vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -696,47 +695,46 @@
auto* object = isNullOrUndefined ? nullptr : value.getObject();
if (UNLIKELY(!isNullOrUndefined && !object)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
if (UNLIKELY(object && object->type() == RegExpObjectType)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
TestObj::DictionaryThatShouldNotTolerateNull result;
JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
if (!booleanWithoutDefaultValue.isUndefined()) {
result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue nonNullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nonNullableNode"));
if (!nonNullableNodeValue.isUndefined()) {
result.nonNullableNode = convert<IDLInterface<Node>>(state, nonNullableNodeValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
JSValue requiredDictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredDictionaryMember"));
if (!requiredDictionaryMemberValue.isUndefined()) {
- auto requiredDictionaryMemberOptional = convert<IDLDictionary<TestObj::Dictionary>>(state, requiredDictionaryMemberValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
- result.requiredDictionaryMember = requiredDictionaryMemberOptional.value();
+ result.requiredDictionaryMember = convert<IDLDictionary<TestObj::Dictionary>>(state, requiredDictionaryMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
JSValue requiredEnumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredEnumerationValue"));
if (!requiredEnumerationValueValue.isUndefined()) {
result.requiredEnumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, requiredEnumerationValueValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
} else {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
- return WTFMove(result);
+ return result;
}
-template<> Optional<TestObj::DictionaryThatShouldTolerateNull> convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(ExecState& state, JSValue value)
+template<> TestObj::DictionaryThatShouldTolerateNull convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(ExecState& state, JSValue value)
{
VM& vm = state.vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -744,27 +742,27 @@
auto* object = isNullOrUndefined ? nullptr : value.getObject();
if (UNLIKELY(!isNullOrUndefined && !object)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
if (UNLIKELY(object && object->type() == RegExpObjectType)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
TestObj::DictionaryThatShouldTolerateNull result;
JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
if (!booleanWithoutDefaultValue.isUndefined()) {
result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
if (!enumerationValueValue.isUndefined()) {
result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
- return WTFMove(result);
+ return result;
}
-template<> Optional<AlternateDictionaryName> convertDictionary<AlternateDictionaryName>(ExecState& state, JSValue value)
+template<> AlternateDictionaryName convertDictionary<AlternateDictionaryName>(ExecState& state, JSValue value)
{
VM& vm = state.vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -772,27 +770,27 @@
auto* object = isNullOrUndefined ? nullptr : value.getObject();
if (UNLIKELY(!isNullOrUndefined && !object)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
if (UNLIKELY(object && object->type() == RegExpObjectType)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
AlternateDictionaryName result;
JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
if (!booleanWithoutDefaultValue.isUndefined()) {
result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
if (!enumerationValueValue.isUndefined()) {
result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
- return WTFMove(result);
+ return result;
}
-template<> Optional<TestObj::ParentDictionary> convertDictionary<TestObj::ParentDictionary>(ExecState& state, JSValue value)
+template<> TestObj::ParentDictionary convertDictionary<TestObj::ParentDictionary>(ExecState& state, JSValue value)
{
VM& vm = state.vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -800,27 +798,27 @@
auto* object = isNullOrUndefined ? nullptr : value.getObject();
if (UNLIKELY(!isNullOrUndefined && !object)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
if (UNLIKELY(object && object->type() == RegExpObjectType)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
TestObj::ParentDictionary result;
JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
if (!parentMember1Value.isUndefined()) {
result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
if (!parentMember2Value.isUndefined()) {
result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
- return WTFMove(result);
+ return result;
}
-template<> Optional<TestObj::ChildDictionary> convertDictionary<TestObj::ChildDictionary>(ExecState& state, JSValue value)
+template<> TestObj::ChildDictionary convertDictionary<TestObj::ChildDictionary>(ExecState& state, JSValue value)
{
VM& vm = state.vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -828,34 +826,34 @@
auto* object = isNullOrUndefined ? nullptr : value.getObject();
if (UNLIKELY(!isNullOrUndefined && !object)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
if (UNLIKELY(object && object->type() == RegExpObjectType)) {
throwTypeError(&state, throwScope);
- return Nullopt;
+ return { };
}
TestObj::ChildDictionary result;
JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
if (!parentMember1Value.isUndefined()) {
result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
if (!parentMember2Value.isUndefined()) {
result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue childMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember1"));
if (!childMember1Value.isUndefined()) {
result.childMember1 = convert<IDLBoolean>(state, childMember1Value);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
JSValue childMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember2"));
if (!childMember2Value.isUndefined()) {
result.childMember2 = convert<IDLBoolean>(state, childMember2Value);
- RETURN_IF_EXCEPTION(throwScope, Nullopt);
+ RETURN_IF_EXCEPTION(throwScope, { });
}
- return WTFMove(result);
+ return result;
}
// Functions