Changeset 227985 in webkit


Ignore:
Timestamp:
Feb 1, 2018 3:33:19 PM (6 years ago)
Author:
Chris Dumez
Message:

Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
https://bugs.webkit.org/show_bug.cgi?id=182392
<rdar://problem/37119215>

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that all checks are passing.

  • web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt:

Source/WebCore:

Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(),
given that getting the property from the object can throw an exception.

No new tests, rebaselined existing test.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateDictionaryImplementationContent):

  • bindings/scripts/test/JS/JSTestCallbackInterface.cpp:

(WebCore::convertDictionary<TestCallbackInterface::Dictionary>):

  • bindings/scripts/test/JS/JSTestEventConstructor.cpp:

(WebCore::convertDictionary<TestEventConstructor::Init>):

  • 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>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):

  • bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:

(WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):

  • bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:

(WebCore::convertDictionary<DictionaryImplName>):

LayoutTests:

Rebaseline existing test now that output is slightly different.

  • fast/events/constructors/message-event-constructor-expected.txt:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r227983 r227985  
     12018-02-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
     4        https://bugs.webkit.org/show_bug.cgi?id=182392
     5        <rdar://problem/37119215>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Rebaseline existing test now that output is slightly different.
     10
     11        * fast/events/constructors/message-event-constructor-expected.txt:
     12
    1132018-02-01  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt

    r207381 r227985  
    9494PASS new MessageEvent('eventType', { ports: NaN }).ports threw exception TypeError: Value is not a sequence.
    9595PASS new MessageEvent('eventType', { get ports() { return 123; } }).ports threw exception TypeError: Value is not a sequence.
    96 PASS new MessageEvent('eventType', { get ports() { throw 'MessageEvent Error'; } }) threw exception TypeError: Value is not a sequence.
     96PASS new MessageEvent('eventType', { get ports() { throw 'MessageEvent Error'; } }) threw exception MessageEvent Error.
    9797PASS new MessageEvent('eventType', { ports: {valueOf: function () { return [channel.port1, channel.port2, channel.port2]; } } }).ports[0] threw exception TypeError: Type error.
    9898PASS new MessageEvent('eventType', { bubbles: true, cancelable: true, data: test_object, origin: 'wonderful', lastEventId: 'excellent', source: window, ports: [channel.port1, channel.port2, channel2.port1] }).bubbles is true
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r227978 r227985  
     12018-02-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
     4        https://bugs.webkit.org/show_bug.cgi?id=182392
     5        <rdar://problem/37119215>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Rebaseline WPT test now that all checks are passing.
     10
     11        * web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt:
     12
    1132018-02-01  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt

    r226086 r227985  
    88PASS `lastEventId` is specified
    99PASS `source` is specified
    10 FAIL `ports` is specified assert_throws: function "function () {
    11       createEvent({ get ports() { throw { name: 'Error' }; } }); }" threw object "TypeError: Value is not a sequence" ("TypeError") expected object "[object Object]" ("Error")
     10PASS `ports` is specified
    1211PASS all initial values are specified
    1312
  • trunk/Source/WebCore/ChangeLog

    r227983 r227985  
     12018-02-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
     4        https://bugs.webkit.org/show_bug.cgi?id=182392
     5        <rdar://problem/37119215>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(),
     10        given that getting the property from the object can throw an exception.
     11
     12        No new tests, rebaselined existing test.
     13
     14        * bindings/scripts/CodeGeneratorJS.pm:
     15        (GenerateDictionaryImplementationContent):
     16        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
     17        (WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
     18        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
     19        (WebCore::convertDictionary<TestEventConstructor::Init>):
     20        * bindings/scripts/test/JS/JSTestObj.cpp:
     21        (WebCore::convertDictionary<TestObj::Dictionary>):
     22        (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
     23        (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
     24        (WebCore::convertDictionary<AlternateDictionaryName>):
     25        (WebCore::convertDictionary<TestObj::ParentDictionary>):
     26        (WebCore::convertDictionary<TestObj::ChildDictionary>):
     27        (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
     28        (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
     29        (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
     30        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
     31        (WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
     32        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
     33        (WebCore::convertDictionary<DictionaryImplName>):
     34
    1352018-02-01  Ryosuke Niwa  <rniwa@webkit.org>
    236
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r227701 r227985  
    23202320
    23212321            # 4.2. Let value be an ECMAScript value, depending on Type(V):
    2322             $result .= "    JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, \"${key}\"));\n";
     2322            $result .= "    JSValue ${key}Value;\n";
     2323            $result .= "    if (isNullOrUndefined)\n";
     2324            $result .= "        ${key}Value = jsUndefined();\n";
     2325            $result .= "    else {\n";
     2326            $result .= "        ${key}Value = object->get(&state, Identifier::fromString(&state, \"${key}\"));\n";
     2327            $result .= "        RETURN_IF_EXCEPTION(throwScope, { });\n";
     2328            $result .= "    }\n";
    23232329
    23242330            my $IDLType = GetIDLType($typeScope, $type);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp

    r224309 r227985  
    9191    }
    9292    TestCallbackInterface::Dictionary result;
    93     JSValue optionalMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "optionalMember"));
     93    JSValue optionalMemberValue;
     94    if (isNullOrUndefined)
     95        optionalMemberValue = jsUndefined();
     96    else {
     97        optionalMemberValue = object->get(&state, Identifier::fromString(&state, "optionalMember"));
     98        RETURN_IF_EXCEPTION(throwScope, { });
     99    }
    94100    if (!optionalMemberValue.isUndefined()) {
    95101        result.optionalMember = convert<IDLLong>(state, optionalMemberValue);
    96102        RETURN_IF_EXCEPTION(throwScope, { });
    97103    }
    98     JSValue requiredMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredMember"));
     104    JSValue requiredMemberValue;
     105    if (isNullOrUndefined)
     106        requiredMemberValue = jsUndefined();
     107    else {
     108        requiredMemberValue = object->get(&state, Identifier::fromString(&state, "requiredMember"));
     109        RETURN_IF_EXCEPTION(throwScope, { });
     110    }
    99111    if (!requiredMemberValue.isUndefined()) {
    100112        result.requiredMember = convert<IDLUSVString>(state, requiredMemberValue);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp

    r227701 r227985  
    4949    }
    5050    TestEventConstructor::Init result;
    51     JSValue bubblesValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bubbles"));
     51    JSValue bubblesValue;
     52    if (isNullOrUndefined)
     53        bubblesValue = jsUndefined();
     54    else {
     55        bubblesValue = object->get(&state, Identifier::fromString(&state, "bubbles"));
     56        RETURN_IF_EXCEPTION(throwScope, { });
     57    }
    5258    if (!bubblesValue.isUndefined()) {
    5359        result.bubbles = convert<IDLBoolean>(state, bubblesValue);
     
    5561    } else
    5662        result.bubbles = false;
    57     JSValue cancelableValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "cancelable"));
     63    JSValue cancelableValue;
     64    if (isNullOrUndefined)
     65        cancelableValue = jsUndefined();
     66    else {
     67        cancelableValue = object->get(&state, Identifier::fromString(&state, "cancelable"));
     68        RETURN_IF_EXCEPTION(throwScope, { });
     69    }
    5870    if (!cancelableValue.isUndefined()) {
    5971        result.cancelable = convert<IDLBoolean>(state, cancelableValue);
     
    6173    } else
    6274        result.cancelable = false;
    63     JSValue composedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "composed"));
     75    JSValue composedValue;
     76    if (isNullOrUndefined)
     77        composedValue = jsUndefined();
     78    else {
     79        composedValue = object->get(&state, Identifier::fromString(&state, "composed"));
     80        RETURN_IF_EXCEPTION(throwScope, { });
     81    }
    6482    if (!composedValue.isUndefined()) {
    6583        result.composed = convert<IDLBoolean>(state, composedValue);
     
    6785    } else
    6886        result.composed = false;
    69     JSValue attr2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr2"));
     87    JSValue attr2Value;
     88    if (isNullOrUndefined)
     89        attr2Value = jsUndefined();
     90    else {
     91        attr2Value = object->get(&state, Identifier::fromString(&state, "attr2"));
     92        RETURN_IF_EXCEPTION(throwScope, { });
     93    }
    7094    if (!attr2Value.isUndefined()) {
    7195        result.attr2 = convert<IDLDOMString>(state, attr2Value);
     
    7397    } else
    7498        result.attr2 = emptyString();
    75     JSValue attr3Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "attr3"));
     99    JSValue attr3Value;
     100    if (isNullOrUndefined)
     101        attr3Value = jsUndefined();
     102    else {
     103        attr3Value = object->get(&state, Identifier::fromString(&state, "attr3"));
     104        RETURN_IF_EXCEPTION(throwScope, { });
     105    }
    76106    if (!attr3Value.isUndefined()) {
    77107        result.attr3 = convert<IDLDOMString>(state, attr3Value);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r227701 r227985  
    430430    }
    431431    TestObj::Dictionary result;
    432     JSValue annotatedTypeInSequenceMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "annotatedTypeInSequenceMember"));
     432    JSValue annotatedTypeInSequenceMemberValue;
     433    if (isNullOrUndefined)
     434        annotatedTypeInSequenceMemberValue = jsUndefined();
     435    else {
     436        annotatedTypeInSequenceMemberValue = object->get(&state, Identifier::fromString(&state, "annotatedTypeInSequenceMember"));
     437        RETURN_IF_EXCEPTION(throwScope, { });
     438    }
    433439    if (!annotatedTypeInSequenceMemberValue.isUndefined()) {
    434440        result.annotatedTypeInSequenceMember = convert<IDLSequence<IDLClampAdaptor<IDLLong>>>(state, annotatedTypeInSequenceMemberValue);
    435441        RETURN_IF_EXCEPTION(throwScope, { });
    436442    }
    437     JSValue annotatedTypeInUnionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "annotatedTypeInUnionMember"));
     443    JSValue annotatedTypeInUnionMemberValue;
     444    if (isNullOrUndefined)
     445        annotatedTypeInUnionMemberValue = jsUndefined();
     446    else {
     447        annotatedTypeInUnionMemberValue = object->get(&state, Identifier::fromString(&state, "annotatedTypeInUnionMember"));
     448        RETURN_IF_EXCEPTION(throwScope, { });
     449    }
    438450    if (!annotatedTypeInUnionMemberValue.isUndefined()) {
    439451        result.annotatedTypeInUnionMember = convert<IDLUnion<IDLDOMString, IDLClampAdaptor<IDLLong>>>(state, annotatedTypeInUnionMemberValue);
    440452        RETURN_IF_EXCEPTION(throwScope, { });
    441453    }
    442     JSValue anyTypedefValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyTypedefValue"));
     454    JSValue anyTypedefValueValue;
     455    if (isNullOrUndefined)
     456        anyTypedefValueValue = jsUndefined();
     457    else {
     458        anyTypedefValueValue = object->get(&state, Identifier::fromString(&state, "anyTypedefValue"));
     459        RETURN_IF_EXCEPTION(throwScope, { });
     460    }
    443461    if (!anyTypedefValueValue.isUndefined()) {
    444462        result.anyTypedefValue = convert<IDLAny>(state, anyTypedefValueValue);
     
    446464    } else
    447465        result.anyTypedefValue = jsUndefined();
    448     JSValue anyValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValue"));
     466    JSValue anyValueValue;
     467    if (isNullOrUndefined)
     468        anyValueValue = jsUndefined();
     469    else {
     470        anyValueValue = object->get(&state, Identifier::fromString(&state, "anyValue"));
     471        RETURN_IF_EXCEPTION(throwScope, { });
     472    }
    449473    if (!anyValueValue.isUndefined()) {
    450474        result.anyValue = convert<IDLAny>(state, anyValueValue);
     
    452476    } else
    453477        result.anyValue = jsUndefined();
    454     JSValue anyValueWithNullDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValueWithNullDefault"));
     478    JSValue anyValueWithNullDefaultValue;
     479    if (isNullOrUndefined)
     480        anyValueWithNullDefaultValue = jsUndefined();
     481    else {
     482        anyValueWithNullDefaultValue = object->get(&state, Identifier::fromString(&state, "anyValueWithNullDefault"));
     483        RETURN_IF_EXCEPTION(throwScope, { });
     484    }
    455485    if (!anyValueWithNullDefaultValue.isUndefined()) {
    456486        result.anyValueWithNullDefault = convert<IDLAny>(state, anyValueWithNullDefaultValue);
     
    458488    } else
    459489        result.anyValueWithNullDefault = jsNull();
    460     JSValue booleanWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithDefault"));
     490    JSValue booleanWithDefaultValue;
     491    if (isNullOrUndefined)
     492        booleanWithDefaultValue = jsUndefined();
     493    else {
     494        booleanWithDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithDefault"));
     495        RETURN_IF_EXCEPTION(throwScope, { });
     496    }
    461497    if (!booleanWithDefaultValue.isUndefined()) {
    462498        result.booleanWithDefault = convert<IDLBoolean>(state, booleanWithDefaultValue);
     
    464500    } else
    465501        result.booleanWithDefault = false;
    466     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     502    JSValue booleanWithoutDefaultValue;
     503    if (isNullOrUndefined)
     504        booleanWithoutDefaultValue = jsUndefined();
     505    else {
     506        booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     507        RETURN_IF_EXCEPTION(throwScope, { });
     508    }
    467509    if (!booleanWithoutDefaultValue.isUndefined()) {
    468510        result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
    469511        RETURN_IF_EXCEPTION(throwScope, { });
    470512    }
    471     JSValue bufferSourceValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bufferSourceValue"));
     513    JSValue bufferSourceValueValue;
     514    if (isNullOrUndefined)
     515        bufferSourceValueValue = jsUndefined();
     516    else {
     517        bufferSourceValueValue = object->get(&state, Identifier::fromString(&state, "bufferSourceValue"));
     518        RETURN_IF_EXCEPTION(throwScope, { });
     519    }
    472520    if (!bufferSourceValueValue.isUndefined()) {
    473521        result.bufferSourceValue = convert<IDLUnion<IDLArrayBufferView, IDLArrayBuffer>>(state, bufferSourceValueValue);
    474522        RETURN_IF_EXCEPTION(throwScope, { });
    475523    }
    476     JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "dictionaryMember"));
     524    JSValue dictionaryMemberValue;
     525    if (isNullOrUndefined)
     526        dictionaryMemberValue = jsUndefined();
     527    else {
     528        dictionaryMemberValue = object->get(&state, Identifier::fromString(&state, "dictionaryMember"));
     529        RETURN_IF_EXCEPTION(throwScope, { });
     530    }
    477531    if (!dictionaryMemberValue.isUndefined()) {
    478532        result.dictionaryMember = convert<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, dictionaryMemberValue);
    479533        RETURN_IF_EXCEPTION(throwScope, { });
    480534    }
    481     JSValue enumerationValueWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithDefault"));
     535    JSValue enumerationValueWithDefaultValue;
     536    if (isNullOrUndefined)
     537        enumerationValueWithDefaultValue = jsUndefined();
     538    else {
     539        enumerationValueWithDefaultValue = object->get(&state, Identifier::fromString(&state, "enumerationValueWithDefault"));
     540        RETURN_IF_EXCEPTION(throwScope, { });
     541    }
    482542    if (!enumerationValueWithDefaultValue.isUndefined()) {
    483543        result.enumerationValueWithDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithDefaultValue);
     
    485545    } else
    486546        result.enumerationValueWithDefault = TestObj::EnumType::EnumValue1;
    487     JSValue enumerationValueWithEmptyStringDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithEmptyStringDefault"));
     547    JSValue enumerationValueWithEmptyStringDefaultValue;
     548    if (isNullOrUndefined)
     549        enumerationValueWithEmptyStringDefaultValue = jsUndefined();
     550    else {
     551        enumerationValueWithEmptyStringDefaultValue = object->get(&state, Identifier::fromString(&state, "enumerationValueWithEmptyStringDefault"));
     552        RETURN_IF_EXCEPTION(throwScope, { });
     553    }
    488554    if (!enumerationValueWithEmptyStringDefaultValue.isUndefined()) {
    489555        result.enumerationValueWithEmptyStringDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithEmptyStringDefaultValue);
     
    491557    } else
    492558        result.enumerationValueWithEmptyStringDefault = TestObj::EnumType::EmptyString;
    493     JSValue enumerationValueWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithoutDefault"));
     559    JSValue enumerationValueWithoutDefaultValue;
     560    if (isNullOrUndefined)
     561        enumerationValueWithoutDefaultValue = jsUndefined();
     562    else {
     563        enumerationValueWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "enumerationValueWithoutDefault"));
     564        RETURN_IF_EXCEPTION(throwScope, { });
     565    }
    494566    if (!enumerationValueWithoutDefaultValue.isUndefined()) {
    495567        result.enumerationValueWithoutDefault = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueWithoutDefaultValue);
    496568        RETURN_IF_EXCEPTION(throwScope, { });
    497569    }
    498     JSValue fooAliasValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "fooAlias"));
     570    JSValue fooAliasValue;
     571    if (isNullOrUndefined)
     572        fooAliasValue = jsUndefined();
     573    else {
     574        fooAliasValue = object->get(&state, Identifier::fromString(&state, "fooAlias"));
     575        RETURN_IF_EXCEPTION(throwScope, { });
     576    }
    499577    if (!fooAliasValue.isUndefined()) {
    500578        result.foo = convert<IDLAny>(state, fooAliasValue);
     
    502580    } else
    503581        result.foo = jsUndefined();
    504     JSValue fooWithDefaultAliasValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "fooWithDefaultAlias"));
     582    JSValue fooWithDefaultAliasValue;
     583    if (isNullOrUndefined)
     584        fooWithDefaultAliasValue = jsUndefined();
     585    else {
     586        fooWithDefaultAliasValue = object->get(&state, Identifier::fromString(&state, "fooWithDefaultAlias"));
     587        RETURN_IF_EXCEPTION(throwScope, { });
     588    }
    505589    if (!fooWithDefaultAliasValue.isUndefined()) {
    506590        result.fooWithDefault = convert<IDLAny>(state, fooWithDefaultAliasValue);
     
    508592    } else
    509593        result.fooWithDefault = 0;
    510     JSValue integerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integer"));
     594    JSValue integerValue;
     595    if (isNullOrUndefined)
     596        integerValue = jsUndefined();
     597    else {
     598        integerValue = object->get(&state, Identifier::fromString(&state, "integer"));
     599        RETURN_IF_EXCEPTION(throwScope, { });
     600    }
    511601    if (!integerValue.isUndefined()) {
    512602        result.integer = convert<IDLLong>(state, integerValue);
    513603        RETURN_IF_EXCEPTION(throwScope, { });
    514604    }
    515     JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integerWithDefault"));
     605    JSValue integerWithDefaultValue;
     606    if (isNullOrUndefined)
     607        integerWithDefaultValue = jsUndefined();
     608    else {
     609        integerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "integerWithDefault"));
     610        RETURN_IF_EXCEPTION(throwScope, { });
     611    }
    516612    if (!integerWithDefaultValue.isUndefined()) {
    517613        result.integerWithDefault = convert<IDLLong>(state, integerWithDefaultValue);
     
    519615    } else
    520616        result.integerWithDefault = 0;
    521     JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeInteger"));
     617    JSValue largeIntegerValue;
     618    if (isNullOrUndefined)
     619        largeIntegerValue = jsUndefined();
     620    else {
     621        largeIntegerValue = object->get(&state, Identifier::fromString(&state, "largeInteger"));
     622        RETURN_IF_EXCEPTION(throwScope, { });
     623    }
    522624    if (!largeIntegerValue.isUndefined()) {
    523625        result.largeInteger = convert<IDLLongLong>(state, largeIntegerValue);
    524626        RETURN_IF_EXCEPTION(throwScope, { });
    525627    }
    526     JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault"));
     628    JSValue largeIntegerWithDefaultValue;
     629    if (isNullOrUndefined)
     630        largeIntegerWithDefaultValue = jsUndefined();
     631    else {
     632        largeIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault"));
     633        RETURN_IF_EXCEPTION(throwScope, { });
     634    }
    527635    if (!largeIntegerWithDefaultValue.isUndefined()) {
    528636        result.largeIntegerWithDefault = convert<IDLLongLong>(state, largeIntegerWithDefaultValue);
     
    530638    } else
    531639        result.largeIntegerWithDefault = 0;
    532     JSValue nullableIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableIntegerWithDefault"));
     640    JSValue nullableIntegerWithDefaultValue;
     641    if (isNullOrUndefined)
     642        nullableIntegerWithDefaultValue = jsUndefined();
     643    else {
     644        nullableIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "nullableIntegerWithDefault"));
     645        RETURN_IF_EXCEPTION(throwScope, { });
     646    }
    533647    if (!nullableIntegerWithDefaultValue.isUndefined()) {
    534648        result.nullableIntegerWithDefault = convert<IDLNullable<IDLLong>>(state, nullableIntegerWithDefaultValue);
     
    536650    } else
    537651        result.nullableIntegerWithDefault = std::nullopt;
    538     JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableNode"));
     652    JSValue nullableNodeValue;
     653    if (isNullOrUndefined)
     654        nullableNodeValue = jsUndefined();
     655    else {
     656        nullableNodeValue = object->get(&state, Identifier::fromString(&state, "nullableNode"));
     657        RETURN_IF_EXCEPTION(throwScope, { });
     658    }
    539659    if (!nullableNodeValue.isUndefined()) {
    540660        result.nullableNode = convert<IDLNullable<IDLInterface<Node>>>(state, nullableNodeValue);
     
    542662    } else
    543663        result.nullableNode = nullptr;
    544     JSValue nullableStringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableStringWithDefault"));
     664    JSValue nullableStringWithDefaultValue;
     665    if (isNullOrUndefined)
     666        nullableStringWithDefaultValue = jsUndefined();
     667    else {
     668        nullableStringWithDefaultValue = object->get(&state, Identifier::fromString(&state, "nullableStringWithDefault"));
     669        RETURN_IF_EXCEPTION(throwScope, { });
     670    }
    545671    if (!nullableStringWithDefaultValue.isUndefined()) {
    546672        result.nullableStringWithDefault = convert<IDLNullable<IDLDOMString>>(state, nullableStringWithDefaultValue);
     
    548674    } else
    549675        result.nullableStringWithDefault = String();
    550     JSValue nullableUnionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableUnionMember"));
     676    JSValue nullableUnionMemberValue;
     677    if (isNullOrUndefined)
     678        nullableUnionMemberValue = jsUndefined();
     679    else {
     680        nullableUnionMemberValue = object->get(&state, Identifier::fromString(&state, "nullableUnionMember"));
     681        RETURN_IF_EXCEPTION(throwScope, { });
     682    }
    551683    if (!nullableUnionMemberValue.isUndefined()) {
    552684        result.nullableUnionMember = convert<IDLNullable<IDLUnion<IDLLong, IDLInterface<Node>>>>(state, nullableUnionMemberValue);
     
    554686    } else
    555687        result.nullableUnionMember = std::nullopt;
    556     JSValue requiredBufferSourceValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredBufferSourceValue"));
     688    JSValue requiredBufferSourceValueValue;
     689    if (isNullOrUndefined)
     690        requiredBufferSourceValueValue = jsUndefined();
     691    else {
     692        requiredBufferSourceValueValue = object->get(&state, Identifier::fromString(&state, "requiredBufferSourceValue"));
     693        RETURN_IF_EXCEPTION(throwScope, { });
     694    }
    557695    if (!requiredBufferSourceValueValue.isUndefined()) {
    558696        result.requiredBufferSourceValue = convert<IDLUnion<IDLArrayBufferView, IDLArrayBuffer>>(state, requiredBufferSourceValueValue);
     
    562700        return { };
    563701    }
    564     JSValue restrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDouble"));
     702    JSValue restrictedDoubleValue;
     703    if (isNullOrUndefined)
     704        restrictedDoubleValue = jsUndefined();
     705    else {
     706        restrictedDoubleValue = object->get(&state, Identifier::fromString(&state, "restrictedDouble"));
     707        RETURN_IF_EXCEPTION(throwScope, { });
     708    }
    565709    if (!restrictedDoubleValue.isUndefined()) {
    566710        result.restrictedDouble = convert<IDLDouble>(state, restrictedDoubleValue);
    567711        RETURN_IF_EXCEPTION(throwScope, { });
    568712    }
    569     JSValue restrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDoubleWithDefault"));
     713    JSValue restrictedDoubleWithDefaultValue;
     714    if (isNullOrUndefined)
     715        restrictedDoubleWithDefaultValue = jsUndefined();
     716    else {
     717        restrictedDoubleWithDefaultValue = object->get(&state, Identifier::fromString(&state, "restrictedDoubleWithDefault"));
     718        RETURN_IF_EXCEPTION(throwScope, { });
     719    }
    570720    if (!restrictedDoubleWithDefaultValue.isUndefined()) {
    571721        result.restrictedDoubleWithDefault = convert<IDLDouble>(state, restrictedDoubleWithDefaultValue);
     
    573723    } else
    574724        result.restrictedDoubleWithDefault = 0;
    575     JSValue restrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloat"));
     725    JSValue restrictedFloatValue;
     726    if (isNullOrUndefined)
     727        restrictedFloatValue = jsUndefined();
     728    else {
     729        restrictedFloatValue = object->get(&state, Identifier::fromString(&state, "restrictedFloat"));
     730        RETURN_IF_EXCEPTION(throwScope, { });
     731    }
    576732    if (!restrictedFloatValue.isUndefined()) {
    577733        result.restrictedFloat = convert<IDLFloat>(state, restrictedFloatValue);
    578734        RETURN_IF_EXCEPTION(throwScope, { });
    579735    }
    580     JSValue restrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloatWithDefault"));
     736    JSValue restrictedFloatWithDefaultValue;
     737    if (isNullOrUndefined)
     738        restrictedFloatWithDefaultValue = jsUndefined();
     739    else {
     740        restrictedFloatWithDefaultValue = object->get(&state, Identifier::fromString(&state, "restrictedFloatWithDefault"));
     741        RETURN_IF_EXCEPTION(throwScope, { });
     742    }
    581743    if (!restrictedFloatWithDefaultValue.isUndefined()) {
    582744        result.restrictedFloatWithDefault = convert<IDLFloat>(state, restrictedFloatWithDefaultValue);
     
    584746    } else
    585747        result.restrictedFloatWithDefault = 0;
    586     JSValue sequenceOfStringsValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "sequenceOfStrings"));
     748    JSValue sequenceOfStringsValue;
     749    if (isNullOrUndefined)
     750        sequenceOfStringsValue = jsUndefined();
     751    else {
     752        sequenceOfStringsValue = object->get(&state, Identifier::fromString(&state, "sequenceOfStrings"));
     753        RETURN_IF_EXCEPTION(throwScope, { });
     754    }
    587755    if (!sequenceOfStringsValue.isUndefined()) {
    588756        result.sequenceOfStrings = convert<IDLSequence<IDLDOMString>>(state, sequenceOfStringsValue);
    589757        RETURN_IF_EXCEPTION(throwScope, { });
    590758    }
    591     JSValue smallIntegerClampedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerClamped"));
     759    JSValue smallIntegerClampedValue;
     760    if (isNullOrUndefined)
     761        smallIntegerClampedValue = jsUndefined();
     762    else {
     763        smallIntegerClampedValue = object->get(&state, Identifier::fromString(&state, "smallIntegerClamped"));
     764        RETURN_IF_EXCEPTION(throwScope, { });
     765    }
    592766    if (!smallIntegerClampedValue.isUndefined()) {
    593767        result.smallIntegerClamped = convert<IDLClampAdaptor<IDLByte>>(state, smallIntegerClampedValue);
    594768        RETURN_IF_EXCEPTION(throwScope, { });
    595769    }
    596     JSValue smallIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault"));
     770    JSValue smallIntegerWithDefaultValue;
     771    if (isNullOrUndefined)
     772        smallIntegerWithDefaultValue = jsUndefined();
     773    else {
     774        smallIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault"));
     775        RETURN_IF_EXCEPTION(throwScope, { });
     776    }
    597777    if (!smallIntegerWithDefaultValue.isUndefined()) {
    598778        result.smallIntegerWithDefault = convert<IDLByte>(state, smallIntegerWithDefaultValue);
    599779        RETURN_IF_EXCEPTION(throwScope, { });
    600780    }
    601     JSValue smallUnsignedIntegerEnforcedRangeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange"));
     781    JSValue smallUnsignedIntegerEnforcedRangeValue;
     782    if (isNullOrUndefined)
     783        smallUnsignedIntegerEnforcedRangeValue = jsUndefined();
     784    else {
     785        smallUnsignedIntegerEnforcedRangeValue = object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange"));
     786        RETURN_IF_EXCEPTION(throwScope, { });
     787    }
    602788    if (!smallUnsignedIntegerEnforcedRangeValue.isUndefined()) {
    603789        result.smallUnsignedIntegerEnforcedRange = convert<IDLEnforceRangeAdaptor<IDLOctet>>(state, smallUnsignedIntegerEnforcedRangeValue);
    604790        RETURN_IF_EXCEPTION(throwScope, { });
    605791    }
    606     JSValue smallUnsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault"));
     792    JSValue smallUnsignedIntegerWithDefaultValue;
     793    if (isNullOrUndefined)
     794        smallUnsignedIntegerWithDefaultValue = jsUndefined();
     795    else {
     796        smallUnsignedIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault"));
     797        RETURN_IF_EXCEPTION(throwScope, { });
     798    }
    607799    if (!smallUnsignedIntegerWithDefaultValue.isUndefined()) {
    608800        result.smallUnsignedIntegerWithDefault = convert<IDLOctet>(state, smallUnsignedIntegerWithDefaultValue);
     
    610802    } else
    611803        result.smallUnsignedIntegerWithDefault = 0;
    612     JSValue stringTreatNullAsEmptyStringValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringTreatNullAsEmptyString"));
     804    JSValue stringTreatNullAsEmptyStringValue;
     805    if (isNullOrUndefined)
     806        stringTreatNullAsEmptyStringValue = jsUndefined();
     807    else {
     808        stringTreatNullAsEmptyStringValue = object->get(&state, Identifier::fromString(&state, "stringTreatNullAsEmptyString"));
     809        RETURN_IF_EXCEPTION(throwScope, { });
     810    }
    613811    if (!stringTreatNullAsEmptyStringValue.isUndefined()) {
    614812        result.stringTreatNullAsEmptyString = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, stringTreatNullAsEmptyStringValue);
    615813        RETURN_IF_EXCEPTION(throwScope, { });
    616814    }
    617     JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithDefault"));
     815    JSValue stringWithDefaultValue;
     816    if (isNullOrUndefined)
     817        stringWithDefaultValue = jsUndefined();
     818    else {
     819        stringWithDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithDefault"));
     820        RETURN_IF_EXCEPTION(throwScope, { });
     821    }
    618822    if (!stringWithDefaultValue.isUndefined()) {
    619823        result.stringWithDefault = convert<IDLDOMString>(state, stringWithDefaultValue);
     
    621825    } else
    622826        result.stringWithDefault = ASCIILiteral("defaultString");
    623     JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     827    JSValue stringWithoutDefaultValue;
     828    if (isNullOrUndefined)
     829        stringWithoutDefaultValue = jsUndefined();
     830    else {
     831        stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     832        RETURN_IF_EXCEPTION(throwScope, { });
     833    }
    624834    if (!stringWithoutDefaultValue.isUndefined()) {
    625835        result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
    626836        RETURN_IF_EXCEPTION(throwScope, { });
    627837    }
    628     JSValue unionMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unionMember"));
     838    JSValue unionMemberValue;
     839    if (isNullOrUndefined)
     840        unionMemberValue = jsUndefined();
     841    else {
     842        unionMemberValue = object->get(&state, Identifier::fromString(&state, "unionMember"));
     843        RETURN_IF_EXCEPTION(throwScope, { });
     844    }
    629845    if (!unionMemberValue.isUndefined()) {
    630846        result.unionMember = convert<IDLUnion<IDLLong, IDLInterface<Node>>>(state, unionMemberValue);
    631847        RETURN_IF_EXCEPTION(throwScope, { });
    632848    }
    633     JSValue unrestrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDouble"));
     849    JSValue unrestrictedDoubleValue;
     850    if (isNullOrUndefined)
     851        unrestrictedDoubleValue = jsUndefined();
     852    else {
     853        unrestrictedDoubleValue = object->get(&state, Identifier::fromString(&state, "unrestrictedDouble"));
     854        RETURN_IF_EXCEPTION(throwScope, { });
     855    }
    634856    if (!unrestrictedDoubleValue.isUndefined()) {
    635857        result.unrestrictedDouble = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleValue);
    636858        RETURN_IF_EXCEPTION(throwScope, { });
    637859    }
    638     JSValue unrestrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDoubleWithDefault"));
     860    JSValue unrestrictedDoubleWithDefaultValue;
     861    if (isNullOrUndefined)
     862        unrestrictedDoubleWithDefaultValue = jsUndefined();
     863    else {
     864        unrestrictedDoubleWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unrestrictedDoubleWithDefault"));
     865        RETURN_IF_EXCEPTION(throwScope, { });
     866    }
    639867    if (!unrestrictedDoubleWithDefaultValue.isUndefined()) {
    640868        result.unrestrictedDoubleWithDefault = convert<IDLUnrestrictedDouble>(state, unrestrictedDoubleWithDefaultValue);
     
    642870    } else
    643871        result.unrestrictedDoubleWithDefault = 0;
    644     JSValue unrestrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloat"));
     872    JSValue unrestrictedFloatValue;
     873    if (isNullOrUndefined)
     874        unrestrictedFloatValue = jsUndefined();
     875    else {
     876        unrestrictedFloatValue = object->get(&state, Identifier::fromString(&state, "unrestrictedFloat"));
     877        RETURN_IF_EXCEPTION(throwScope, { });
     878    }
    645879    if (!unrestrictedFloatValue.isUndefined()) {
    646880        result.unrestrictedFloat = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatValue);
    647881        RETURN_IF_EXCEPTION(throwScope, { });
    648882    }
    649     JSValue unrestrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloatWithDefault"));
     883    JSValue unrestrictedFloatWithDefaultValue;
     884    if (isNullOrUndefined)
     885        unrestrictedFloatWithDefaultValue = jsUndefined();
     886    else {
     887        unrestrictedFloatWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unrestrictedFloatWithDefault"));
     888        RETURN_IF_EXCEPTION(throwScope, { });
     889    }
    650890    if (!unrestrictedFloatWithDefaultValue.isUndefined()) {
    651891        result.unrestrictedFloatWithDefault = convert<IDLUnrestrictedFloat>(state, unrestrictedFloatWithDefaultValue);
     
    653893    } else
    654894        result.unrestrictedFloatWithDefault = 0;
    655     JSValue unsignedIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedInteger"));
     895    JSValue unsignedIntegerValue;
     896    if (isNullOrUndefined)
     897        unsignedIntegerValue = jsUndefined();
     898    else {
     899        unsignedIntegerValue = object->get(&state, Identifier::fromString(&state, "unsignedInteger"));
     900        RETURN_IF_EXCEPTION(throwScope, { });
     901    }
    656902    if (!unsignedIntegerValue.isUndefined()) {
    657903        result.unsignedInteger = convert<IDLUnsignedLong>(state, unsignedIntegerValue);
    658904        RETURN_IF_EXCEPTION(throwScope, { });
    659905    }
    660     JSValue unsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault"));
     906    JSValue unsignedIntegerWithDefaultValue;
     907    if (isNullOrUndefined)
     908        unsignedIntegerWithDefaultValue = jsUndefined();
     909    else {
     910        unsignedIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault"));
     911        RETURN_IF_EXCEPTION(throwScope, { });
     912    }
    661913    if (!unsignedIntegerWithDefaultValue.isUndefined()) {
    662914        result.unsignedIntegerWithDefault = convert<IDLUnsignedLong>(state, unsignedIntegerWithDefaultValue);
     
    664916    } else
    665917        result.unsignedIntegerWithDefault = 0;
    666     JSValue unsignedLargeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger"));
     918    JSValue unsignedLargeIntegerValue;
     919    if (isNullOrUndefined)
     920        unsignedLargeIntegerValue = jsUndefined();
     921    else {
     922        unsignedLargeIntegerValue = object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger"));
     923        RETURN_IF_EXCEPTION(throwScope, { });
     924    }
    667925    if (!unsignedLargeIntegerValue.isUndefined()) {
    668926        result.unsignedLargeInteger = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerValue);
    669927        RETURN_IF_EXCEPTION(throwScope, { });
    670928    }
    671     JSValue unsignedLargeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault"));
     929    JSValue unsignedLargeIntegerWithDefaultValue;
     930    if (isNullOrUndefined)
     931        unsignedLargeIntegerWithDefaultValue = jsUndefined();
     932    else {
     933        unsignedLargeIntegerWithDefaultValue = object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault"));
     934        RETURN_IF_EXCEPTION(throwScope, { });
     935    }
    672936    if (!unsignedLargeIntegerWithDefaultValue.isUndefined()) {
    673937        result.unsignedLargeIntegerWithDefault = convert<IDLUnsignedLongLong>(state, unsignedLargeIntegerWithDefaultValue);
     
    8281092    }
    8291093    TestObj::DictionaryThatShouldNotTolerateNull result;
    830     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     1094    JSValue booleanWithoutDefaultValue;
     1095    if (isNullOrUndefined)
     1096        booleanWithoutDefaultValue = jsUndefined();
     1097    else {
     1098        booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     1099        RETURN_IF_EXCEPTION(throwScope, { });
     1100    }
    8311101    if (!booleanWithoutDefaultValue.isUndefined()) {
    8321102        result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
    8331103        RETURN_IF_EXCEPTION(throwScope, { });
    8341104    }
    835     JSValue nonNullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nonNullableNode"));
     1105    JSValue nonNullableNodeValue;
     1106    if (isNullOrUndefined)
     1107        nonNullableNodeValue = jsUndefined();
     1108    else {
     1109        nonNullableNodeValue = object->get(&state, Identifier::fromString(&state, "nonNullableNode"));
     1110        RETURN_IF_EXCEPTION(throwScope, { });
     1111    }
    8361112    if (!nonNullableNodeValue.isUndefined()) {
    8371113        result.nonNullableNode = convert<IDLInterface<Node>>(state, nonNullableNodeValue);
     
    8411117        return { };
    8421118    }
    843     JSValue requiredDictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredDictionaryMember"));
     1119    JSValue requiredDictionaryMemberValue;
     1120    if (isNullOrUndefined)
     1121        requiredDictionaryMemberValue = jsUndefined();
     1122    else {
     1123        requiredDictionaryMemberValue = object->get(&state, Identifier::fromString(&state, "requiredDictionaryMember"));
     1124        RETURN_IF_EXCEPTION(throwScope, { });
     1125    }
    8441126    if (!requiredDictionaryMemberValue.isUndefined()) {
    8451127        result.requiredDictionaryMember = convert<IDLDictionary<TestObj::Dictionary>>(state, requiredDictionaryMemberValue);
     
    8491131        return { };
    8501132    }
    851     JSValue requiredEnumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredEnumerationValue"));
     1133    JSValue requiredEnumerationValueValue;
     1134    if (isNullOrUndefined)
     1135        requiredEnumerationValueValue = jsUndefined();
     1136    else {
     1137        requiredEnumerationValueValue = object->get(&state, Identifier::fromString(&state, "requiredEnumerationValue"));
     1138        RETURN_IF_EXCEPTION(throwScope, { });
     1139    }
    8521140    if (!requiredEnumerationValueValue.isUndefined()) {
    8531141        result.requiredEnumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, requiredEnumerationValueValue);
     
    8711159    }
    8721160    TestObj::DictionaryThatShouldTolerateNull result;
    873     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     1161    JSValue booleanWithoutDefaultValue;
     1162    if (isNullOrUndefined)
     1163        booleanWithoutDefaultValue = jsUndefined();
     1164    else {
     1165        booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     1166        RETURN_IF_EXCEPTION(throwScope, { });
     1167    }
    8741168    if (!booleanWithoutDefaultValue.isUndefined()) {
    8751169        result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
    8761170        RETURN_IF_EXCEPTION(throwScope, { });
    8771171    }
    878     JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
     1172    JSValue enumerationValueValue;
     1173    if (isNullOrUndefined)
     1174        enumerationValueValue = jsUndefined();
     1175    else {
     1176        enumerationValueValue = object->get(&state, Identifier::fromString(&state, "enumerationValue"));
     1177        RETURN_IF_EXCEPTION(throwScope, { });
     1178    }
    8791179    if (!enumerationValueValue.isUndefined()) {
    8801180        result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue);
     
    8951195    }
    8961196    AlternateDictionaryName result;
    897     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     1197    JSValue booleanWithoutDefaultValue;
     1198    if (isNullOrUndefined)
     1199        booleanWithoutDefaultValue = jsUndefined();
     1200    else {
     1201        booleanWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
     1202        RETURN_IF_EXCEPTION(throwScope, { });
     1203    }
    8981204    if (!booleanWithoutDefaultValue.isUndefined()) {
    8991205        result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
    9001206        RETURN_IF_EXCEPTION(throwScope, { });
    9011207    }
    902     JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
     1208    JSValue enumerationValueValue;
     1209    if (isNullOrUndefined)
     1210        enumerationValueValue = jsUndefined();
     1211    else {
     1212        enumerationValueValue = object->get(&state, Identifier::fromString(&state, "enumerationValue"));
     1213        RETURN_IF_EXCEPTION(throwScope, { });
     1214    }
    9031215    if (!enumerationValueValue.isUndefined()) {
    9041216        result.enumerationValue = convert<IDLEnumeration<TestObj::EnumType>>(state, enumerationValueValue);
     
    9191231    }
    9201232    TestObj::ParentDictionary result;
    921     JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
     1233    JSValue parentMember1Value;
     1234    if (isNullOrUndefined)
     1235        parentMember1Value = jsUndefined();
     1236    else {
     1237        parentMember1Value = object->get(&state, Identifier::fromString(&state, "parentMember1"));
     1238        RETURN_IF_EXCEPTION(throwScope, { });
     1239    }
    9221240    if (!parentMember1Value.isUndefined()) {
    9231241        result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value);
    9241242        RETURN_IF_EXCEPTION(throwScope, { });
    9251243    }
    926     JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
     1244    JSValue parentMember2Value;
     1245    if (isNullOrUndefined)
     1246        parentMember2Value = jsUndefined();
     1247    else {
     1248        parentMember2Value = object->get(&state, Identifier::fromString(&state, "parentMember2"));
     1249        RETURN_IF_EXCEPTION(throwScope, { });
     1250    }
    9271251    if (!parentMember2Value.isUndefined()) {
    9281252        result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value);
     
    9431267    }
    9441268    TestObj::ChildDictionary result;
    945     JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
     1269    JSValue parentMember1Value;
     1270    if (isNullOrUndefined)
     1271        parentMember1Value = jsUndefined();
     1272    else {
     1273        parentMember1Value = object->get(&state, Identifier::fromString(&state, "parentMember1"));
     1274        RETURN_IF_EXCEPTION(throwScope, { });
     1275    }
    9461276    if (!parentMember1Value.isUndefined()) {
    9471277        result.parentMember1 = convert<IDLBoolean>(state, parentMember1Value);
    9481278        RETURN_IF_EXCEPTION(throwScope, { });
    9491279    }
    950     JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
     1280    JSValue parentMember2Value;
     1281    if (isNullOrUndefined)
     1282        parentMember2Value = jsUndefined();
     1283    else {
     1284        parentMember2Value = object->get(&state, Identifier::fromString(&state, "parentMember2"));
     1285        RETURN_IF_EXCEPTION(throwScope, { });
     1286    }
    9511287    if (!parentMember2Value.isUndefined()) {
    9521288        result.parentMember2 = convert<IDLBoolean>(state, parentMember2Value);
    9531289        RETURN_IF_EXCEPTION(throwScope, { });
    9541290    }
    955     JSValue childMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember1"));
     1291    JSValue childMember1Value;
     1292    if (isNullOrUndefined)
     1293        childMember1Value = jsUndefined();
     1294    else {
     1295        childMember1Value = object->get(&state, Identifier::fromString(&state, "childMember1"));
     1296        RETURN_IF_EXCEPTION(throwScope, { });
     1297    }
    9561298    if (!childMember1Value.isUndefined()) {
    9571299        result.childMember1 = convert<IDLBoolean>(state, childMember1Value);
    9581300        RETURN_IF_EXCEPTION(throwScope, { });
    9591301    }
    960     JSValue childMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember2"));
     1302    JSValue childMember2Value;
     1303    if (isNullOrUndefined)
     1304        childMember2Value = jsUndefined();
     1305    else {
     1306        childMember2Value = object->get(&state, Identifier::fromString(&state, "childMember2"));
     1307        RETURN_IF_EXCEPTION(throwScope, { });
     1308    }
    9611309    if (!childMember2Value.isUndefined()) {
    9621310        result.childMember2 = convert<IDLBoolean>(state, childMember2Value);
     
    9791327    }
    9801328    TestObj::ConditionalDictionaryA result;
    981     JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     1329    JSValue stringWithoutDefaultValue;
     1330    if (isNullOrUndefined)
     1331        stringWithoutDefaultValue = jsUndefined();
     1332    else {
     1333        stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     1334        RETURN_IF_EXCEPTION(throwScope, { });
     1335    }
    9821336    if (!stringWithoutDefaultValue.isUndefined()) {
    9831337        result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
     
    10021356    }
    10031357    TestObj::ConditionalDictionaryB result;
    1004     JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     1358    JSValue stringWithoutDefaultValue;
     1359    if (isNullOrUndefined)
     1360        stringWithoutDefaultValue = jsUndefined();
     1361    else {
     1362        stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     1363        RETURN_IF_EXCEPTION(throwScope, { });
     1364    }
    10051365    if (!stringWithoutDefaultValue.isUndefined()) {
    10061366        result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
     
    10251385    }
    10261386    TestObj::ConditionalDictionaryC result;
    1027     JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     1387    JSValue stringWithoutDefaultValue;
     1388    if (isNullOrUndefined)
     1389        stringWithoutDefaultValue = jsUndefined();
     1390    else {
     1391        stringWithoutDefaultValue = object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
     1392        RETURN_IF_EXCEPTION(throwScope, { });
     1393    }
    10281394    if (!stringWithoutDefaultValue.isUndefined()) {
    10291395        result.stringWithoutDefault = convert<IDLDOMString>(state, stringWithoutDefaultValue);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp

    r227701 r227985  
    5353    }
    5454    TestPromiseRejectionEvent::Init result;
    55     JSValue bubblesValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bubbles"));
     55    JSValue bubblesValue;
     56    if (isNullOrUndefined)
     57        bubblesValue = jsUndefined();
     58    else {
     59        bubblesValue = object->get(&state, Identifier::fromString(&state, "bubbles"));
     60        RETURN_IF_EXCEPTION(throwScope, { });
     61    }
    5662    if (!bubblesValue.isUndefined()) {
    5763        result.bubbles = convert<IDLBoolean>(state, bubblesValue);
     
    5965    } else
    6066        result.bubbles = false;
    61     JSValue cancelableValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "cancelable"));
     67    JSValue cancelableValue;
     68    if (isNullOrUndefined)
     69        cancelableValue = jsUndefined();
     70    else {
     71        cancelableValue = object->get(&state, Identifier::fromString(&state, "cancelable"));
     72        RETURN_IF_EXCEPTION(throwScope, { });
     73    }
    6274    if (!cancelableValue.isUndefined()) {
    6375        result.cancelable = convert<IDLBoolean>(state, cancelableValue);
     
    6577    } else
    6678        result.cancelable = false;
    67     JSValue composedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "composed"));
     79    JSValue composedValue;
     80    if (isNullOrUndefined)
     81        composedValue = jsUndefined();
     82    else {
     83        composedValue = object->get(&state, Identifier::fromString(&state, "composed"));
     84        RETURN_IF_EXCEPTION(throwScope, { });
     85    }
    6886    if (!composedValue.isUndefined()) {
    6987        result.composed = convert<IDLBoolean>(state, composedValue);
     
    7189    } else
    7290        result.composed = false;
    73     JSValue promiseValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "promise"));
     91    JSValue promiseValue;
     92    if (isNullOrUndefined)
     93        promiseValue = jsUndefined();
     94    else {
     95        promiseValue = object->get(&state, Identifier::fromString(&state, "promise"));
     96        RETURN_IF_EXCEPTION(throwScope, { });
     97    }
    7498    if (!promiseValue.isUndefined()) {
    7599        result.promise = convert<IDLPromise<IDLAny>>(state, promiseValue);
     
    79103        return { };
    80104    }
    81     JSValue reasonValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "reason"));
     105    JSValue reasonValue;
     106    if (isNullOrUndefined)
     107        reasonValue = jsUndefined();
     108    else {
     109        reasonValue = object->get(&state, Identifier::fromString(&state, "reason"));
     110        RETURN_IF_EXCEPTION(throwScope, { });
     111    }
    82112    if (!reasonValue.isUndefined()) {
    83113        result.reason = convert<IDLAny>(state, reasonValue);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp

    r223476 r227985  
    4848    }
    4949    DictionaryImplName result;
    50     JSValue boolMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "boolMember"));
     50    JSValue boolMemberValue;
     51    if (isNullOrUndefined)
     52        boolMemberValue = jsUndefined();
     53    else {
     54        boolMemberValue = object->get(&state, Identifier::fromString(&state, "boolMember"));
     55        RETURN_IF_EXCEPTION(throwScope, { });
     56    }
    5157    if (!boolMemberValue.isUndefined()) {
    5258        result.boolMember = convert<IDLBoolean>(state, boolMemberValue);
    5359        RETURN_IF_EXCEPTION(throwScope, { });
    5460    }
    55     JSValue enumMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumMember"));
     61    JSValue enumMemberValue;
     62    if (isNullOrUndefined)
     63        enumMemberValue = jsUndefined();
     64    else {
     65        enumMemberValue = object->get(&state, Identifier::fromString(&state, "enumMember"));
     66        RETURN_IF_EXCEPTION(throwScope, { });
     67    }
    5668    if (!enumMemberValue.isUndefined()) {
    5769        result.enumMember = convert<IDLEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>>(state, enumMemberValue);
    5870        RETURN_IF_EXCEPTION(throwScope, { });
    5971    }
    60     JSValue stringMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringMember"));
     72    JSValue stringMemberValue;
     73    if (isNullOrUndefined)
     74        stringMemberValue = jsUndefined();
     75    else {
     76        stringMemberValue = object->get(&state, Identifier::fromString(&state, "stringMember"));
     77        RETURN_IF_EXCEPTION(throwScope, { });
     78    }
    6179    if (!stringMemberValue.isUndefined()) {
    6280        result.stringMember = convert<IDLDOMString>(state, stringMemberValue);
Note: See TracChangeset for help on using the changeset viewer.