Changeset 266999 in webkit


Ignore:
Timestamp:
Sep 13, 2020 11:13:02 AM (4 years ago)
Author:
weinig@apple.com
Message:

[WebIDL] Remove need for [MayThrowException] on indexed and named setters
https://bugs.webkit.org/show_bug.cgi?id=216441

Reviewed by Darin Adler.

Deduce implementation potentially throwing by introspecting the return
type of the setters implementation in a new helper, invokeFunctorPropagatingExceptionIfNecessary.
This allows us to remove another set of uses of [MayThrowException].

  • bindings/js/JSDOMConvertBase.h:
  • dom/ExceptionOr.h:

Move IsExceptionOr to ExceptionOr.h so it can be used more widely.

  • bindings/js/JSDOMExceptionHandling.h:

(WebCore::invokeFunctorPropagatingExceptionIfNecessary):
Add helper that invokes the passed in functor and calls propagateException
if the return type was an ExceptionOr<>. If the return type is not an
ExceptionOr<>, it just invokes the functor and returns.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateInvokeIndexedPropertySetter):
(GenerateInvokeNamedPropertySetter):
Update to call invokeFunctorPropagatingExceptionIfNecessary.

  • css/CSSStyleDeclaration.idl:
  • dom/DOMStringMap.idl:
  • storage/Storage.idl:
  • svg/SVGLengthList.idl:
  • svg/SVGNumberList.idl:
  • svg/SVGPathSegList.idl:
  • svg/SVGPointList.idl:
  • svg/SVGStringList.idl:
  • svg/SVGTransformList.idl:

Remove now unneeded [MayThrowException].

  • bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
  • bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
  • bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
  • bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
  • bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
  • bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp:
  • bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp:
  • bindings/scripts/test/TestIndexedSetterThrowingException.idl:
  • bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl:
  • bindings/scripts/test/TestNamedSetterThrowingException.idl:

Update tests/expectations.

Location:
trunk/Source/WebCore
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r266998 r266999  
     12020-09-13  Sam Weinig  <weinig@apple.com>
     2
     3        [WebIDL] Remove need for [MayThrowException] on indexed and named setters
     4        https://bugs.webkit.org/show_bug.cgi?id=216441
     5
     6        Reviewed by Darin Adler.
     7
     8        Deduce implementation potentially throwing by introspecting the return
     9        type of the setters implementation in a new helper, invokeFunctorPropagatingExceptionIfNecessary.
     10        This allows us to remove another set of uses of [MayThrowException].
     11
     12        * bindings/js/JSDOMConvertBase.h:
     13        * dom/ExceptionOr.h:
     14        Move IsExceptionOr to ExceptionOr.h so it can be used more widely.
     15
     16        * bindings/js/JSDOMExceptionHandling.h:
     17        (WebCore::invokeFunctorPropagatingExceptionIfNecessary):
     18        Add helper that invokes the passed in functor and calls propagateException
     19        if the return type was an ExceptionOr<>. If the return type is not an
     20        ExceptionOr<>, it just invokes the functor and returns.
     21
     22        * bindings/scripts/CodeGeneratorJS.pm:
     23        (GenerateInvokeIndexedPropertySetter):
     24        (GenerateInvokeNamedPropertySetter):
     25        Update to call invokeFunctorPropagatingExceptionIfNecessary.
     26
     27        * css/CSSStyleDeclaration.idl:
     28        * dom/DOMStringMap.idl:
     29        * storage/Storage.idl:
     30        * svg/SVGLengthList.idl:
     31        * svg/SVGNumberList.idl:
     32        * svg/SVGPathSegList.idl:
     33        * svg/SVGPointList.idl:
     34        * svg/SVGStringList.idl:
     35        * svg/SVGTransformList.idl:
     36        Remove now unneeded [MayThrowException].
     37
     38        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
     39        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
     40        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
     41        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
     42        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
     43        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
     44        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
     45        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
     46        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
     47        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
     48        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
     49        * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp:
     50        * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp:
     51        * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp:
     52        * bindings/scripts/test/TestIndexedSetterThrowingException.idl:
     53        * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl:
     54        * bindings/scripts/test/TestNamedSetterThrowingException.idl:
     55        Update tests/expectations.
     56
    1572020-09-13  Sam Weinig  <weinig@apple.com>
    258
  • trunk/Source/WebCore/bindings/js/JSDOMConvertBase.h

    r251425 r266999  
    8888
    8989
    90 template <typename T>
    91 struct IsExceptionOr : public std::integral_constant<bool, WTF::IsTemplate<std::decay_t<T>, ExceptionOr>::value> { };
    92 
    93 
    9490// Conversion from Implementation -> JSValue
    9591template<typename T> struct JSConverter;
  • trunk/Source/WebCore/bindings/js/JSDOMExceptionHandling.h

    r263638 r266999  
    9090}
    9191
     92template<typename Functor> void invokeFunctorPropagatingExceptionIfNecessary(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, Functor&& functor)
     93{
     94    using ReturnType = std::invoke_result_t<Functor>;
     95
     96    if constexpr (IsExceptionOr<ReturnType>::value) {
     97        auto result = functor();
     98        if (UNLIKELY(result.hasException()))
     99            propagateException(lexicalGlobalObject, throwScope, result.releaseException());
     100        return;
     101    }
     102
     103    functor();
     104}
     105
    92106} // namespace WebCore
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r266983 r266999  
    898898    my $nativeValuePassExpression = PassArgumentExpression("nativeValue", $argument);
    899899    my $functionString = "thisObject->wrapped().${indexedSetterFunctionName}(${indexExpression}, ${nativeValuePassExpression})";
    900     $functionString = "propagateException(*lexicalGlobalObject, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterOperation);
    901    
    902     push(@$outputArray, $indent . $functionString . ";\n");
     900    push(@$outputArray, $indent . "invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return ${functionString}; });\n");
    903901}
    904902
     
    926924
    927925    my $functionString = "thisObject->wrapped().${namedSetterFunctionName}(" . join(", ", @arguments) . ")";
    928     $functionString = "propagateException(*lexicalGlobalObject, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($namedSetterOperation);
    929 
    930     push(@$outputArray, $indent . $functionString . ";\n");
     926    push(@$outputArray, $indent . "invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return ${functionString}; });\n");
    931927}
    932928
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp

    r260992 r266999  
    199199        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    200200        RETURN_IF_EXCEPTION(throwScope, true);
    201         thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
     201        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    202202        return true;
    203203    }
     
    215215        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    216216        RETURN_IF_EXCEPTION(throwScope, true);
    217         thisObject->wrapped().setItem(index, WTFMove(nativeValue));
     217        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index, WTFMove(nativeValue)); });
    218218        return true;
    219219    }
     
    233233        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    234234        RETURN_IF_EXCEPTION(throwScope, true);
    235         thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
     235        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    236236        return true;
    237237    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp

    r260992 r266999  
    199199        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    200200        RETURN_IF_EXCEPTION(throwScope, true);
    201         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
     201        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    202202        return true;
    203203    }
     
    215215        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    216216        RETURN_IF_EXCEPTION(throwScope, true);
    217         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setItem(index, WTFMove(nativeValue)));
     217        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index, WTFMove(nativeValue)); });
    218218        return true;
    219219    }
     
    233233        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    234234        RETURN_IF_EXCEPTION(throwScope, true);
    235         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
     235        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    236236        return true;
    237237    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp

    r265046 r266999  
    206206        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    207207        RETURN_IF_EXCEPTION(throwScope, true);
    208         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
     208        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); });
    209209        return true;
    210210    }
     
    222222        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    223223        RETURN_IF_EXCEPTION(throwScope, true);
    224         thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue));
     224        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue)); });
    225225        return true;
    226226    }
     
    240240        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    241241        RETURN_IF_EXCEPTION(throwScope, true);
    242         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
     242        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); });
    243243        return true;
    244244    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp

    r266662 r266999  
    230230        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    231231        RETURN_IF_EXCEPTION(throwScope, true);
    232         thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
     232        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    233233        return true;
    234234    }
     
    243243            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    244244            RETURN_IF_EXCEPTION(throwScope, true);
    245             thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     245            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    246246            return true;
    247247        }
     
    261261        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    262262        RETURN_IF_EXCEPTION(throwScope, true);
    263         thisObject->wrapped().setItem(index, WTFMove(nativeValue));
     263        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index, WTFMove(nativeValue)); });
    264264        return true;
    265265    }
     
    274274        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    275275        RETURN_IF_EXCEPTION(throwScope, true);
    276         thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     276        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    277277        return true;
    278278    }
     
    292292        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    293293        RETURN_IF_EXCEPTION(throwScope, true);
    294         thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue));
     294        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    295295        return true;
    296296    }
     
    306306            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    307307            RETURN_IF_EXCEPTION(throwScope, true);
    308             thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     308            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    309309            return true;
    310310        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp

    r266662 r266999  
    230230        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    231231        RETURN_IF_EXCEPTION(throwScope, true);
    232         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
     232        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    233233        return true;
    234234    }
     
    243243            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    244244            RETURN_IF_EXCEPTION(throwScope, true);
    245             propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
     245            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    246246            return true;
    247247        }
     
    261261        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    262262        RETURN_IF_EXCEPTION(throwScope, true);
    263         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setItem(index, WTFMove(nativeValue)));
     263        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index, WTFMove(nativeValue)); });
    264264        return true;
    265265    }
     
    274274        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    275275        RETURN_IF_EXCEPTION(throwScope, true);
    276         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
     276        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    277277        return true;
    278278    }
     
    292292        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    293293        RETURN_IF_EXCEPTION(throwScope, true);
    294         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)));
     294        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setItem(index.value(), WTFMove(nativeValue)); });
    295295        return true;
    296296    }
     
    306306            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    307307            RETURN_IF_EXCEPTION(throwScope, true);
    308             propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
     308            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    309309            return true;
    310310        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp

    r266662 r266999  
    239239        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    240240        RETURN_IF_EXCEPTION(throwScope, true);
    241         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
     241        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); });
    242242        return true;
    243243    }
     
    252252            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    253253            RETURN_IF_EXCEPTION(throwScope, true);
    254             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     254            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    255255            return true;
    256256        }
     
    270270        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    271271        RETURN_IF_EXCEPTION(throwScope, true);
    272         thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue));
     272        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue)); });
    273273        return true;
    274274    }
     
    283283        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    284284        RETURN_IF_EXCEPTION(throwScope, true);
    285         thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     285        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    286286        return true;
    287287    }
     
    301301        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    302302        RETURN_IF_EXCEPTION(throwScope, true);
    303         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
     303        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); });
    304304        return true;
    305305    }
     
    315315            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    316316            RETURN_IF_EXCEPTION(throwScope, true);
    317             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     317            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    318318            return true;
    319319        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp

    r266662 r266999  
    216216            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    217217            RETURN_IF_EXCEPTION(throwScope, true);
    218             thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     218            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    219219            return true;
    220220        }
     
    239239        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    240240        RETURN_IF_EXCEPTION(throwScope, true);
    241         thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     241        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    242242        return true;
    243243    }
     
    261261            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    262262            RETURN_IF_EXCEPTION(throwScope, true);
    263             thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     263            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    264264            return true;
    265265        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp

    r266662 r266999  
    216216            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    217217            RETURN_IF_EXCEPTION(throwScope, true);
    218             propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
     218            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    219219            return true;
    220220        }
     
    239239        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    240240        RETURN_IF_EXCEPTION(throwScope, true);
    241         propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
     241        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    242242        return true;
    243243    }
     
    261261            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    262262            RETURN_IF_EXCEPTION(throwScope, true);
    263             propagateException(*lexicalGlobalObject, throwScope, thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)));
     263            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    264264            return true;
    265265        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp

    r266662 r266999  
    222222            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    223223            RETURN_IF_EXCEPTION(throwScope, true);
    224             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     224            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    225225            return true;
    226226        }
     
    245245        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    246246        RETURN_IF_EXCEPTION(throwScope, true);
    247         thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     247        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    248248        return true;
    249249    }
     
    267267            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    268268            RETURN_IF_EXCEPTION(throwScope, true);
    269             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     269            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    270270            return true;
    271271        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp

    r266662 r266999  
    244244            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    245245            RETURN_IF_EXCEPTION(throwScope, true);
    246             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     246            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    247247            return true;
    248248        }
     
    267267        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    268268        RETURN_IF_EXCEPTION(throwScope, true);
    269         thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     269        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    270270        return true;
    271271    }
     
    292292            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    293293            RETURN_IF_EXCEPTION(throwScope, true);
    294             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     294            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    295295            return true;
    296296        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp

    r266662 r266999  
    239239        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    240240        RETURN_IF_EXCEPTION(throwScope, true);
    241         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
     241        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); });
    242242        return true;
    243243    }
     
    252252            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    253253            RETURN_IF_EXCEPTION(throwScope, true);
    254             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     254            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    255255            return true;
    256256        }
     
    270270        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    271271        RETURN_IF_EXCEPTION(throwScope, true);
    272         thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue));
     272        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue)); });
    273273        return true;
    274274    }
     
    283283        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    284284        RETURN_IF_EXCEPTION(throwScope, true);
    285         thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     285        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    286286        return true;
    287287    }
     
    301301        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    302302        RETURN_IF_EXCEPTION(throwScope, true);
    303         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
     303        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue)); });
    304304        return true;
    305305    }
     
    315315            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    316316            RETURN_IF_EXCEPTION(throwScope, true);
    317             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
     317            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    318318            return true;
    319319        }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp

    r266662 r266999  
    211211        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    212212        RETURN_IF_EXCEPTION(throwScope, true);
    213         thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     213        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    214214        return true;
    215215    }
     
    228228    auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    229229    RETURN_IF_EXCEPTION(throwScope, true);
    230     thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     230    invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    231231    return true;
    232232}
     
    243243        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    244244        RETURN_IF_EXCEPTION(throwScope, true);
    245         thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     245        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    246246        return true;
    247247    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp

    r266662 r266999  
    240240            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    241241            RETURN_IF_EXCEPTION(throwScope, true);
    242             thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     242            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    243243            return true;
    244244        }
     
    263263        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    264264        RETURN_IF_EXCEPTION(throwScope, true);
    265         thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     265        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    266266        return true;
    267267    }
     
    291291                auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    292292                RETURN_IF_EXCEPTION(throwScope, true);
    293                 thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     293                invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    294294                return true;
    295295            }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp

    r266662 r266999  
    235235        auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    236236        RETURN_IF_EXCEPTION(throwScope, true);
    237         thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     237        invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    238238        return true;
    239239    }
     
    252252    auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, value);
    253253    RETURN_IF_EXCEPTION(throwScope, true);
    254     thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     254    invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    255255    return true;
    256256}
     
    273273            auto nativeValue = convert<IDLDOMString>(*lexicalGlobalObject, propertyDescriptor.value());
    274274            RETURN_IF_EXCEPTION(throwScope, true);
    275             thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
     275            invokeFunctorPropagatingExceptionIfNecessary(*lexicalGlobalObject, throwScope, [&] { return thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue)); });
    276276            return true;
    277277        }
  • trunk/Source/WebCore/bindings/scripts/test/TestIndexedSetterThrowingException.idl

    r266311 r266999  
    2525
    2626interface TestIndexedSetterThrowingException {
    27     [MayThrowException] setter undefined (unsigned long index, DOMString value);
     27    setter undefined (unsigned long index, DOMString value);
    2828
    2929    // NOTE: Indexed setters require the presence of a indexed getter as well.
  • trunk/Source/WebCore/bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl

    r266311 r266999  
    2525
    2626interface TestNamedAndIndexedSetterThrowingException {
    27     [MayThrowException] setter undefined (DOMString name, DOMString value);
     27    setter undefined (DOMString name, DOMString value);
    2828    getter DOMString (DOMString name);
    2929
    30     [MayThrowException] setter undefined (unsigned long index, DOMString value);
     30    setter undefined (unsigned long index, DOMString value);
    3131    getter DOMString (unsigned long index);
    3232};
  • trunk/Source/WebCore/bindings/scripts/test/TestNamedSetterThrowingException.idl

    r266311 r266999  
    2525
    2626interface TestNamedSetterThrowingException {
    27     [MayThrowException] setter undefined (DOMString name, DOMString value);
     27    setter undefined (DOMString name, DOMString value);
    2828
    2929    // NOTE: Named setters require the presence of a named getter as well.
  • trunk/Source/WebCore/css/CSSStyleDeclaration.idl

    r266662 r266999  
    5050    // reconsider this decision.
    5151    getter (DOMString or double) (DOMString name);
    52     [CEReactions, MayThrowException, CallNamedSetterOnlyForSupportedProperties] setter undefined (DOMString name, [LegacyNullToEmptyString] DOMString value);
     52    [CEReactions, CallNamedSetterOnlyForSupportedProperties] setter undefined (DOMString name, [LegacyNullToEmptyString] DOMString value);
    5353
    5454    // This method is deprecated, and we would like to drop support for it someday
  • trunk/Source/WebCore/dom/DOMStringMap.idl

    r266662 r266999  
    3030] interface DOMStringMap {
    3131    getter DOMString (DOMString name);
    32     [CEReactions, MayThrowException] setter undefined (DOMString name, DOMString value);
     32    [CEReactions] setter undefined (DOMString name, DOMString value);
    3333    [CEReactions] deleter undefined (DOMString name);
    3434};
  • trunk/Source/WebCore/dom/ExceptionOr.h

    r264958 r266999  
    3030#include <wtf/CrossThreadCopier.h>
    3131#include <wtf/Expected.h>
     32#include <wtf/StdLibExtras.h>
    3233
    3334namespace WebCore {
     
    200201}
    201202
     203template <typename T> struct IsExceptionOr : public std::integral_constant<bool, WTF::IsTemplate<std::decay_t<T>, ExceptionOr>::value> { };
     204
    202205}
    203206
  • trunk/Source/WebCore/storage/Storage.idl

    r266983 r266999  
    3131    DOMString? key(unsigned long index);
    3232    getter DOMString? getItem(DOMString key);
    33     [MayThrowException] setter undefined setItem(DOMString key, DOMString data);
     33    setter undefined setItem(DOMString key, DOMString data);
    3434    deleter undefined removeItem(DOMString key);
    3535    [MayThrowException] undefined clear();
  • trunk/Source/WebCore/svg/SVGLengthList.idl

    r266311 r266999  
    3838    [MayThrowException] SVGLength removeItem(unsigned long index);
    3939    [MayThrowException] SVGLength appendItem(SVGLength newItem);
    40     [MayThrowException] setter undefined (unsigned long index, SVGLength newItem);
     40    setter undefined (unsigned long index, SVGLength newItem);
    4141};
  • trunk/Source/WebCore/svg/SVGNumberList.idl

    r266311 r266999  
    3636    [MayThrowException] SVGNumber removeItem(unsigned long index);
    3737    [MayThrowException] SVGNumber appendItem(SVGNumber newItem);
    38     [MayThrowException] setter undefined (unsigned long index, SVGNumber newItem);
     38    setter undefined (unsigned long index, SVGNumber newItem);
    3939};
  • trunk/Source/WebCore/svg/SVGPathSegList.idl

    r266311 r266999  
    3636    [MayThrowException] SVGPathSeg removeItem(unsigned long index);
    3737    [MayThrowException] SVGPathSeg appendItem(SVGPathSeg newItem);
    38     [MayThrowException] setter undefined (unsigned long index, SVGPathSeg newItem);
     38    setter undefined (unsigned long index, SVGPathSeg newItem);
    3939};
  • trunk/Source/WebCore/svg/SVGPointList.idl

    r266311 r266999  
    3535    [MayThrowException] SVGPoint removeItem(unsigned long index);
    3636    [MayThrowException] SVGPoint appendItem(SVGPoint newItem);
    37     [MayThrowException] setter undefined (unsigned long index, SVGPoint newItem);
     37    setter undefined (unsigned long index, SVGPoint newItem);
    3838};
  • trunk/Source/WebCore/svg/SVGStringList.idl

    r266311 r266999  
    3535    [MayThrowException] DOMString removeItem(unsigned long index);
    3636    [MayThrowException] DOMString appendItem(DOMString newItem);
    37     [MayThrowException] setter undefined (unsigned long index, DOMString newItem);
     37    setter undefined (unsigned long index, DOMString newItem);
    3838};
  • trunk/Source/WebCore/svg/SVGTransformList.idl

    r266311 r266999  
    3636    [MayThrowException] SVGTransform removeItem(unsigned long index);
    3737    [MayThrowException] SVGTransform appendItem(SVGTransform newItem);
    38     [MayThrowException] setter undefined (unsigned long index, SVGTransform newItem);
     38    setter undefined (unsigned long index, SVGTransform newItem);
    3939
    4040    [MayThrowException, NewObject] SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInit matrix);
Note: See TracChangeset for help on using the changeset viewer.