convertDictionary<>() no longer needs to return an Optional<> type
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 23:18:55 +0000 (23:18 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2016 23:18:55 +0000 (23:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163624

Reviewed by Sam Weinig.

convertDictionary<>() no longer needs to return an Optional<> type now
that our dictionary structures are all default constructible after
<https://trac.webkit.org/changeset/206974>.

* bindings/js/JSDOMConvert.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryHeaderContent):
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207498 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMConvert.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h

index b62c5df..a7787ce 100644 (file)
@@ -1,5 +1,35 @@
 2016-10-18  Chris Dumez  <cdumez@apple.com>
 
+        convertDictionary<>() no longer needs to return an Optional<> type
+        https://bugs.webkit.org/show_bug.cgi?id=163624
+
+        Reviewed by Sam Weinig.
+
+        convertDictionary<>() no longer needs to return an Optional<> type now
+        that our dictionary structures are all default constructible after
+        <https://trac.webkit.org/changeset/206974>.
+
+        * bindings/js/JSDOMConvert.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateDictionaryHeaderContent):
+        (GenerateDictionaryImplementationContent):
+        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+        (WebCore::convertDictionary<TestEventConstructor::Init>):
+        * bindings/scripts/test/JS/JSTestEventConstructor.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::convertDictionary<TestObj::Dictionary>):
+        (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
+        (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
+        (WebCore::convertDictionary<AlternateDictionaryName>):
+        (WebCore::convertDictionary<TestObj::ParentDictionary>):
+        (WebCore::convertDictionary<TestObj::ChildDictionary>):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
+        (WebCore::convertDictionary<DictionaryImplName>):
+        * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
+
+2016-10-18  Chris Dumez  <cdumez@apple.com>
+
         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
         https://bugs.webkit.org/show_bug.cgi?id=163608
 
index af6043a..11a947d 100644 (file)
@@ -42,7 +42,7 @@ template<typename T> EnableIfNotIntegralType<T> convert(JSC::ExecState&, JSC::JS
 template<typename T> EnableIfIntegralType<T> convert(JSC::ExecState&, JSC::JSValue, IntegerConversionConfiguration = NormalConversion);
 
 // Specialized by generated code for IDL dictionary conversion.
-template<typename T> Optional<T> convertDictionary(JSC::ExecState&, JSC::JSValue);
+template<typename T> T convertDictionary(JSC::ExecState&, JSC::JSValue);
 
 // Specialized by generated code for IDL enumeration conversion.
 template<typename T> Optional<T> parseEnumeration(JSC::ExecState&, JSC::JSValue);
index 643adaf..b3c04f7 100644 (file)
@@ -1051,7 +1051,7 @@ sub GenerateDictionaryHeaderContent
     my $result = "";
     my $conditionalString = $codeGenerator->GenerateConditionalString($dictionary);
     $result .= "#if ${conditionalString}\n\n" if $conditionalString;
-    $result .= "template<> Optional<$className> convertDictionary<$className>(JSC::ExecState&, JSC::JSValue);\n\n";
+    $result .= "template<> $className convertDictionary<$className>(JSC::ExecState&, JSC::JSValue);\n\n";
     $result .= "#endif\n\n" if $conditionalString;
     return $result;
 }
@@ -1088,7 +1088,7 @@ sub GenerateDictionaryImplementationContent
     AddToImplIncludes("JSDOMConvert.h");
 
     # https://heycam.github.io/webidl/#es-dictionary
-    $result .= "template<> Optional<$className> convertDictionary<$className>(ExecState& state, JSValue value)\n";
+    $result .= "template<> $className convertDictionary<$className>(ExecState& state, JSValue value)\n";
     $result .= "{\n";
     $result .= "    VM& vm = state.vm();\n";
     $result .= "    auto throwScope = DECLARE_THROW_SCOPE(vm);\n";
@@ -1097,14 +1097,14 @@ sub GenerateDictionaryImplementationContent
     # 1. If Type(V) is not Undefined, Null or Object, then throw a TypeError.
     $result .= "    if (UNLIKELY(!isNullOrUndefined && !object)) {\n";
     $result .= "        throwTypeError(&state, throwScope);\n";
-    $result .= "        return Nullopt;\n";
+    $result .= "        return { };\n";
     $result .= "    }\n";
 
     # 2. If V is a native RegExp object, then throw a TypeError.
     # FIXME: This RegExp special handling is likely to go away in the specification.
     $result .= "    if (UNLIKELY(object && object->type() == RegExpObjectType)) {\n";
     $result .= "        throwTypeError(&state, throwScope);\n";
-    $result .= "        return Nullopt;\n";
+    $result .= "        return { };\n";
     $result .= "    }\n";
 
     # 3. Let dict be an empty dictionary value of type D; every dictionary member is initially considered to be not present.
@@ -1145,16 +1145,8 @@ sub GenerateDictionaryImplementationContent
 
             # 5.3. If value is not undefined, then:
             $result .= "    if (!${key}Value.isUndefined()) {\n";
-
-            # FIXME: We should figure out a way to merge these two cases.
-            if ($codeGenerator->IsDictionaryType($idlType->name)) {
-                $result .= "        auto ${key}Optional = convert<${IDLType}>(state, ${key}Value);\n";
-                $result .= "        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
-                $result .= "        result.$key = ${key}Optional.value();\n";
-            } else {
-                $result .= "        result.$key = convert<${IDLType}>(state, ${key}Value);\n";
-                $result .= "        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
-            }
+            $result .= "        result.$key = convert<${IDLType}>(state, ${key}Value);\n";
+            $result .= "        RETURN_IF_EXCEPTION(throwScope, { });\n";
 
             # Value is undefined.
             # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
@@ -1165,7 +1157,7 @@ sub GenerateDictionaryImplementationContent
                 # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
                 $result .= "    } else {\n";
                 $result .= "        throwTypeError(&state, throwScope);\n";
-                $result .= "        return Nullopt;\n";
+                $result .= "        return { };\n";
                 $result .= "    }\n";
             } else {
                 $result .= "    }\n";
@@ -1173,7 +1165,7 @@ sub GenerateDictionaryImplementationContent
         }
     }
 
-    $result .= "    return WTFMove(result);\n";
+    $result .= "    return result;\n";
     $result .= "}\n\n";
     $result .= "#endif\n\n" if $conditionalString;
 
index 3c48116..402c5ec 100644 (file)
@@ -33,7 +33,7 @@ using namespace JSC;
 
 namespace WebCore {
 
-template<> Optional<TestEventConstructor::Init> convertDictionary<TestEventConstructor::Init>(ExecState& state, JSValue value)
+template<> TestEventConstructor::Init convertDictionary<TestEventConstructor::Init>(ExecState& state, JSValue value)
 {
     VM& vm = state.vm();
     auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -41,44 +41,44 @@ template<> Optional<TestEventConstructor::Init> convertDictionary<TestEventConst
     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 { };
     }
     TestEventConstructor::Init result;
     JSValue bubblesValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bubbles"));
     if (!bubblesValue.isUndefined()) {
         result.bubbles = convert<IDLBoolean>(state, bubblesValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        RETURN_IF_EXCEPTION(throwScope, { });
     } else
         result.bubbles = false;
     JSValue cancelableValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "cancelable"));
     if (!cancelableValue.isUndefined()) {
         result.cancelable = convert<IDLBoolean>(state, cancelableValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        RETURN_IF_EXCEPTION(throwScope, { });
     } else
         result.cancelable = false;
     JSValue composedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "composed"));
     if (!composedValue.isUndefined()) {
         result.composed = convert<IDLBoolean>(state, composedValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        RETURN_IF_EXCEPTION(throwScope, { });
     } else
         result.composed = false;
     JSValue attr2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr2"));
     if (!attr2Value.isUndefined()) {
         result.attr2 = convert<IDLDOMString>(state, attr2Value);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        RETURN_IF_EXCEPTION(throwScope, { });
     } else
         result.attr2 = "";
     JSValue attr3Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr3"));
     if (!attr3Value.isUndefined()) {
         result.attr3 = convert<IDLDOMString>(state, attr3Value);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        RETURN_IF_EXCEPTION(throwScope, { });
     } else
         result.attr3 = "";
-    return WTFMove(result);
+    return result;
 }
 
 // Attributes
index 6adad6c..6e5daec 100644 (file)
@@ -71,7 +71,7 @@ inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* g
 template<> struct JSDOMWrapperConverterTraits<TestEventConstructor> {
     using WrapperClass = JSTestEventConstructor;
 };
-template<> Optional<TestEventConstructor::Init> convertDictionary<TestEventConstructor::Init>(JSC::ExecState&, JSC::JSValue);
+template<> TestEventConstructor::Init convertDictionary<TestEventConstructor::Init>(JSC::ExecState&, JSC::JSValue);
 
 
 } // namespace WebCore
index c52a390..adbf697 100644 (file)
@@ -459,7 +459,7 @@ template<> const char* expectedEnumerationValues<TestObj::Confidence>()
     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 @@ template<> Optional<TestObj::Dictionary> convertDictionary<TestObj::Dictionary>(
     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 @@ template<> Optional<TestObj::DictionaryThatShouldNotTolerateNull> convertDiction
     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 @@ template<> Optional<TestObj::DictionaryThatShouldTolerateNull> convertDictionary
     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 @@ template<> Optional<AlternateDictionaryName> convertDictionary<AlternateDictiona
     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 @@ template<> Optional<TestObj::ParentDictionary> convertDictionary<TestObj::Parent
     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 @@ template<> Optional<TestObj::ChildDictionary> convertDictionary<TestObj::ChildDi
     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
index 217f4fb..bfba481 100644 (file)
@@ -207,17 +207,17 @@ template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(J
 template<> TestObj::Confidence convertEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::Confidence>();
 
-template<> Optional<TestObj::Dictionary> convertDictionary<TestObj::Dictionary>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::Dictionary convertDictionary<TestObj::Dictionary>(JSC::ExecState&, JSC::JSValue);
 
-template<> Optional<TestObj::DictionaryThatShouldNotTolerateNull> convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::DictionaryThatShouldNotTolerateNull convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>(JSC::ExecState&, JSC::JSValue);
 
-template<> Optional<TestObj::DictionaryThatShouldTolerateNull> convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::DictionaryThatShouldTolerateNull convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(JSC::ExecState&, JSC::JSValue);
 
-template<> Optional<AlternateDictionaryName> convertDictionary<AlternateDictionaryName>(JSC::ExecState&, JSC::JSValue);
+template<> AlternateDictionaryName convertDictionary<AlternateDictionaryName>(JSC::ExecState&, JSC::JSValue);
 
-template<> Optional<TestObj::ParentDictionary> convertDictionary<TestObj::ParentDictionary>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::ParentDictionary convertDictionary<TestObj::ParentDictionary>(JSC::ExecState&, JSC::JSValue);
 
-template<> Optional<TestObj::ChildDictionary> convertDictionary<TestObj::ChildDictionary>(JSC::ExecState&, JSC::JSValue);
+template<> TestObj::ChildDictionary convertDictionary<TestObj::ChildDictionary>(JSC::ExecState&, JSC::JSValue);
 
 
 } // namespace WebCore
index f9f2625..3d7f0f4 100644 (file)
@@ -26,7 +26,7 @@ using namespace JSC;
 
 namespace WebCore {
 
-template<> Optional<DictionaryImplName> convertDictionary<DictionaryImplName>(ExecState& state, JSValue value)
+template<> DictionaryImplName convertDictionary<DictionaryImplName>(ExecState& state, JSValue value)
 {
     VM& vm = state.vm();
     auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -34,24 +34,24 @@ template<> Optional<DictionaryImplName> convertDictionary<DictionaryImplName>(Ex
     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 { };
     }
     DictionaryImplName result;
     JSValue boolMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "boolMember"));
     if (!boolMemberValue.isUndefined()) {
         result.boolMember = convert<IDLBoolean>(state, boolMemberValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        RETURN_IF_EXCEPTION(throwScope, { });
     }
     JSValue stringMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringMember"));
     if (!stringMemberValue.isUndefined()) {
         result.stringMember = convert<IDLDOMString>(state, stringMemberValue);
-        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        RETURN_IF_EXCEPTION(throwScope, { });
     }
-    return WTFMove(result);
+    return result;
 }
 
 } // namespace WebCore
index f39abba..76a2ab1 100644 (file)
@@ -25,6 +25,6 @@
 
 namespace WebCore {
 
-template<> Optional<DictionaryImplName> convertDictionary<DictionaryImplName>(JSC::ExecState&, JSC::JSValue);
+template<> DictionaryImplName convertDictionary<DictionaryImplName>(JSC::ExecState&, JSC::JSValue);
 
 } // namespace WebCore