From 18c54d8d404ad08dcff07f2be997d2f84d0db065 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Aug 2023 08:41:28 +0200 Subject: [PATCH] LibJS: Make Cell::initialize() return void Stop worrying about tiny OOMs. Work towards #20405 --- Meta/Lagom/Fuzzers/FuzzilliJs.cpp | 8 ++-- .../BindingsGenerator/IDLGenerators.cpp | 42 ++++++++----------- Meta/Lagom/Wasm/js_repl.cpp | 8 ++-- Tests/LibWasm/test-wasm.cpp | 8 ++-- .../Spreadsheet/JSIntegration.cpp | 12 ++---- .../Applications/Spreadsheet/JSIntegration.h | 4 +- .../LibJS/Contrib/Test262/262Object.cpp | 12 +++--- .../LibJS/Contrib/Test262/262Object.h | 2 +- .../LibJS/Contrib/Test262/AgentObject.cpp | 6 +-- .../LibJS/Contrib/Test262/AgentObject.h | 2 +- .../LibJS/Contrib/Test262/GlobalObject.cpp | 8 ++-- .../LibJS/Contrib/Test262/GlobalObject.h | 2 +- Userland/Libraries/LibJS/Heap/Cell.cpp | 3 +- Userland/Libraries/LibJS/Heap/Cell.h | 2 +- Userland/Libraries/LibJS/Heap/Heap.h | 2 +- .../Runtime/AggregateErrorConstructor.cpp | 6 +-- .../LibJS/Runtime/AggregateErrorConstructor.h | 2 +- .../LibJS/Runtime/AggregateErrorPrototype.cpp | 8 ++-- .../LibJS/Runtime/AggregateErrorPrototype.h | 2 +- .../LibJS/Runtime/ArgumentsObject.cpp | 6 +-- .../Libraries/LibJS/Runtime/ArgumentsObject.h | 2 +- .../LibJS/Runtime/ArrayBufferConstructor.cpp | 6 +-- .../LibJS/Runtime/ArrayBufferConstructor.h | 2 +- .../LibJS/Runtime/ArrayBufferPrototype.cpp | 6 +-- .../LibJS/Runtime/ArrayBufferPrototype.h | 2 +- .../LibJS/Runtime/ArrayConstructor.cpp | 6 +-- .../LibJS/Runtime/ArrayConstructor.h | 2 +- .../LibJS/Runtime/ArrayIteratorPrototype.cpp | 8 ++-- .../LibJS/Runtime/ArrayIteratorPrototype.h | 2 +- .../LibJS/Runtime/ArrayPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/ArrayPrototype.h | 2 +- .../LibJS/Runtime/AsyncFromSyncIterator.cpp | 6 --- .../LibJS/Runtime/AsyncFromSyncIterator.h | 1 - .../AsyncFromSyncIteratorPrototype.cpp | 6 +-- .../Runtime/AsyncFromSyncIteratorPrototype.h | 2 +- .../Runtime/AsyncFunctionConstructor.cpp | 6 +-- .../LibJS/Runtime/AsyncFunctionConstructor.h | 2 +- .../LibJS/Runtime/AsyncFunctionPrototype.cpp | 6 +-- .../LibJS/Runtime/AsyncFunctionPrototype.h | 2 +- .../AsyncGeneratorFunctionConstructor.cpp | 6 +-- .../AsyncGeneratorFunctionConstructor.h | 2 +- .../AsyncGeneratorFunctionPrototype.cpp | 6 +-- .../Runtime/AsyncGeneratorFunctionPrototype.h | 2 +- .../LibJS/Runtime/AsyncGeneratorPrototype.cpp | 8 ++-- .../LibJS/Runtime/AsyncGeneratorPrototype.h | 2 +- .../LibJS/Runtime/AsyncIteratorPrototype.cpp | 6 +-- .../LibJS/Runtime/AsyncIteratorPrototype.h | 2 +- .../Libraries/LibJS/Runtime/AtomicsObject.cpp | 8 ++-- .../Libraries/LibJS/Runtime/AtomicsObject.h | 2 +- .../LibJS/Runtime/BigIntConstructor.cpp | 6 +-- .../LibJS/Runtime/BigIntConstructor.h | 2 +- .../LibJS/Runtime/BigIntPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/BigIntPrototype.h | 2 +- .../LibJS/Runtime/BooleanConstructor.cpp | 6 +-- .../LibJS/Runtime/BooleanConstructor.h | 2 +- .../LibJS/Runtime/BooleanPrototype.cpp | 6 +-- .../LibJS/Runtime/BooleanPrototype.h | 2 +- .../Libraries/LibJS/Runtime/ConsoleObject.cpp | 6 +-- .../Libraries/LibJS/Runtime/ConsoleObject.h | 2 +- .../LibJS/Runtime/DataViewConstructor.cpp | 6 +-- .../LibJS/Runtime/DataViewConstructor.h | 2 +- .../LibJS/Runtime/DataViewPrototype.cpp | 6 +-- .../LibJS/Runtime/DataViewPrototype.h | 2 +- .../LibJS/Runtime/DateConstructor.cpp | 6 +-- .../Libraries/LibJS/Runtime/DateConstructor.h | 2 +- .../Libraries/LibJS/Runtime/DatePrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/DatePrototype.h | 2 +- .../Runtime/DisposableStackConstructor.cpp | 6 +-- .../Runtime/DisposableStackConstructor.h | 2 +- .../Runtime/DisposableStackPrototype.cpp | 6 +-- .../LibJS/Runtime/DisposableStackPrototype.h | 2 +- .../Runtime/ECMAScriptFunctionObject.cpp | 8 ++-- .../LibJS/Runtime/ECMAScriptFunctionObject.h | 2 +- .../LibJS/Runtime/ErrorConstructor.cpp | 12 ++---- .../LibJS/Runtime/ErrorConstructor.h | 4 +- .../LibJS/Runtime/ErrorPrototype.cpp | 36 +++++++--------- .../Libraries/LibJS/Runtime/ErrorPrototype.h | 4 +- .../FinalizationRegistryConstructor.cpp | 6 +-- .../Runtime/FinalizationRegistryConstructor.h | 2 +- .../Runtime/FinalizationRegistryPrototype.cpp | 6 +-- .../Runtime/FinalizationRegistryPrototype.h | 2 +- .../LibJS/Runtime/FunctionConstructor.cpp | 6 +-- .../LibJS/Runtime/FunctionConstructor.h | 2 +- .../Libraries/LibJS/Runtime/FunctionObject.h | 1 - .../LibJS/Runtime/FunctionPrototype.cpp | 6 +-- .../LibJS/Runtime/FunctionPrototype.h | 2 +- .../Runtime/GeneratorFunctionConstructor.cpp | 6 +-- .../Runtime/GeneratorFunctionConstructor.h | 2 +- .../Runtime/GeneratorFunctionPrototype.cpp | 8 ++-- .../Runtime/GeneratorFunctionPrototype.h | 2 +- .../LibJS/Runtime/GeneratorPrototype.cpp | 8 ++-- .../LibJS/Runtime/GeneratorPrototype.h | 2 +- .../Libraries/LibJS/Runtime/GlobalObject.cpp | 6 +-- .../Libraries/LibJS/Runtime/GlobalObject.h | 2 +- .../Runtime/Intl/CollatorCompareFunction.cpp | 4 +- .../Runtime/Intl/CollatorCompareFunction.h | 2 +- .../Runtime/Intl/CollatorConstructor.cpp | 6 +-- .../LibJS/Runtime/Intl/CollatorConstructor.h | 2 +- .../LibJS/Runtime/Intl/CollatorPrototype.cpp | 8 ++-- .../LibJS/Runtime/Intl/CollatorPrototype.h | 2 +- .../Intl/DateTimeFormatConstructor.cpp | 6 +-- .../Runtime/Intl/DateTimeFormatConstructor.h | 2 +- .../Runtime/Intl/DateTimeFormatFunction.cpp | 6 +-- .../Runtime/Intl/DateTimeFormatFunction.h | 2 +- .../Runtime/Intl/DateTimeFormatPrototype.cpp | 8 ++-- .../Runtime/Intl/DateTimeFormatPrototype.h | 2 +- .../Runtime/Intl/DisplayNamesConstructor.cpp | 6 +-- .../Runtime/Intl/DisplayNamesConstructor.h | 2 +- .../Runtime/Intl/DisplayNamesPrototype.cpp | 8 ++-- .../Runtime/Intl/DisplayNamesPrototype.h | 2 +- .../Intl/DurationFormatConstructor.cpp | 6 +-- .../Runtime/Intl/DurationFormatConstructor.h | 2 +- .../Runtime/Intl/DurationFormatPrototype.cpp | 8 ++-- .../Runtime/Intl/DurationFormatPrototype.h | 2 +- .../Libraries/LibJS/Runtime/Intl/Intl.cpp | 8 ++-- Userland/Libraries/LibJS/Runtime/Intl/Intl.h | 2 +- .../Runtime/Intl/ListFormatConstructor.cpp | 6 +-- .../Runtime/Intl/ListFormatConstructor.h | 2 +- .../Runtime/Intl/ListFormatPrototype.cpp | 8 ++-- .../LibJS/Runtime/Intl/ListFormatPrototype.h | 2 +- .../LibJS/Runtime/Intl/LocaleConstructor.cpp | 6 +-- .../LibJS/Runtime/Intl/LocaleConstructor.h | 2 +- .../LibJS/Runtime/Intl/LocalePrototype.cpp | 8 ++-- .../LibJS/Runtime/Intl/LocalePrototype.h | 2 +- .../Runtime/Intl/NumberFormatConstructor.cpp | 6 +-- .../Runtime/Intl/NumberFormatConstructor.h | 2 +- .../Runtime/Intl/NumberFormatFunction.cpp | 6 +-- .../LibJS/Runtime/Intl/NumberFormatFunction.h | 2 +- .../Runtime/Intl/NumberFormatPrototype.cpp | 8 ++-- .../Runtime/Intl/NumberFormatPrototype.h | 2 +- .../Runtime/Intl/PluralRulesConstructor.cpp | 6 +-- .../Runtime/Intl/PluralRulesConstructor.h | 2 +- .../Runtime/Intl/PluralRulesPrototype.cpp | 8 ++-- .../LibJS/Runtime/Intl/PluralRulesPrototype.h | 2 +- .../Intl/RelativeTimeFormatConstructor.cpp | 6 +-- .../Intl/RelativeTimeFormatConstructor.h | 2 +- .../Intl/RelativeTimeFormatPrototype.cpp | 8 ++-- .../Intl/RelativeTimeFormatPrototype.h | 2 +- .../Runtime/Intl/SegmentIteratorPrototype.cpp | 8 ++-- .../Runtime/Intl/SegmentIteratorPrototype.h | 2 +- .../Runtime/Intl/SegmenterConstructor.cpp | 6 +-- .../LibJS/Runtime/Intl/SegmenterConstructor.h | 2 +- .../LibJS/Runtime/Intl/SegmenterPrototype.cpp | 8 ++-- .../LibJS/Runtime/Intl/SegmenterPrototype.h | 2 +- .../LibJS/Runtime/Intl/SegmentsPrototype.cpp | 6 +-- .../LibJS/Runtime/Intl/SegmentsPrototype.h | 2 +- .../Libraries/LibJS/Runtime/Intrinsics.cpp | 4 +- .../LibJS/Runtime/IteratorConstructor.cpp | 6 +-- .../LibJS/Runtime/IteratorConstructor.h | 2 +- .../LibJS/Runtime/IteratorHelperPrototype.cpp | 8 ++-- .../LibJS/Runtime/IteratorHelperPrototype.h | 2 +- .../LibJS/Runtime/IteratorPrototype.cpp | 8 ++-- .../LibJS/Runtime/IteratorPrototype.h | 2 +- .../Libraries/LibJS/Runtime/JSONObject.cpp | 8 ++-- Userland/Libraries/LibJS/Runtime/JSONObject.h | 2 +- .../LibJS/Runtime/MapConstructor.cpp | 6 +-- .../Libraries/LibJS/Runtime/MapConstructor.h | 2 +- .../LibJS/Runtime/MapIteratorPrototype.cpp | 8 ++-- .../LibJS/Runtime/MapIteratorPrototype.h | 2 +- .../Libraries/LibJS/Runtime/MapPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/MapPrototype.h | 2 +- .../Libraries/LibJS/Runtime/MathObject.cpp | 6 +-- Userland/Libraries/LibJS/Runtime/MathObject.h | 2 +- .../LibJS/Runtime/ModuleNamespaceObject.cpp | 8 ++-- .../LibJS/Runtime/ModuleNamespaceObject.h | 2 +- .../Libraries/LibJS/Runtime/NativeFunction.h | 1 - .../LibJS/Runtime/NumberConstructor.cpp | 6 +-- .../LibJS/Runtime/NumberConstructor.h | 2 +- .../LibJS/Runtime/NumberPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/NumberPrototype.h | 2 +- Userland/Libraries/LibJS/Runtime/Object.cpp | 3 +- Userland/Libraries/LibJS/Runtime/Object.h | 2 +- .../LibJS/Runtime/ObjectConstructor.cpp | 6 +-- .../LibJS/Runtime/ObjectConstructor.h | 2 +- .../LibJS/Runtime/ObjectPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/ObjectPrototype.h | 2 +- .../LibJS/Runtime/PromiseConstructor.cpp | 6 +-- .../LibJS/Runtime/PromiseConstructor.h | 2 +- .../LibJS/Runtime/PromisePrototype.cpp | 6 +-- .../LibJS/Runtime/PromisePrototype.h | 2 +- .../PromiseResolvingElementFunctions.cpp | 6 +-- .../PromiseResolvingElementFunctions.h | 2 +- .../Runtime/PromiseResolvingFunction.cpp | 6 +-- .../LibJS/Runtime/PromiseResolvingFunction.h | 2 +- .../LibJS/Runtime/ProxyConstructor.cpp | 6 +-- .../LibJS/Runtime/ProxyConstructor.h | 2 +- Userland/Libraries/LibJS/Runtime/Realm.cpp | 2 +- .../Libraries/LibJS/Runtime/ReflectObject.cpp | 6 +-- .../Libraries/LibJS/Runtime/ReflectObject.h | 2 +- .../LibJS/Runtime/RegExpConstructor.cpp | 6 +-- .../LibJS/Runtime/RegExpConstructor.h | 2 +- .../Libraries/LibJS/Runtime/RegExpObject.cpp | 6 +-- .../Libraries/LibJS/Runtime/RegExpObject.h | 2 +- .../LibJS/Runtime/RegExpPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/RegExpPrototype.h | 2 +- .../Runtime/RegExpStringIteratorPrototype.cpp | 8 ++-- .../Runtime/RegExpStringIteratorPrototype.h | 2 +- Userland/Libraries/LibJS/Runtime/Set.cpp | 4 +- Userland/Libraries/LibJS/Runtime/Set.h | 2 +- .../LibJS/Runtime/SetConstructor.cpp | 6 +-- .../Libraries/LibJS/Runtime/SetConstructor.h | 2 +- .../LibJS/Runtime/SetIteratorPrototype.cpp | 8 ++-- .../LibJS/Runtime/SetIteratorPrototype.h | 2 +- .../Libraries/LibJS/Runtime/SetPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/SetPrototype.h | 2 +- .../LibJS/Runtime/ShadowRealmConstructor.cpp | 8 ++-- .../LibJS/Runtime/ShadowRealmConstructor.h | 2 +- .../LibJS/Runtime/ShadowRealmPrototype.cpp | 6 +-- .../LibJS/Runtime/ShadowRealmPrototype.h | 2 +- .../Runtime/SharedArrayBufferConstructor.cpp | 6 +-- .../Runtime/SharedArrayBufferConstructor.h | 2 +- .../Runtime/SharedArrayBufferPrototype.cpp | 6 +-- .../Runtime/SharedArrayBufferPrototype.h | 2 +- .../LibJS/Runtime/StringConstructor.cpp | 6 +-- .../LibJS/Runtime/StringConstructor.h | 2 +- .../LibJS/Runtime/StringIteratorPrototype.cpp | 8 ++-- .../LibJS/Runtime/StringIteratorPrototype.h | 2 +- .../Libraries/LibJS/Runtime/StringObject.cpp | 8 ++-- .../Libraries/LibJS/Runtime/StringObject.h | 2 +- .../LibJS/Runtime/StringPrototype.cpp | 6 +-- .../Libraries/LibJS/Runtime/StringPrototype.h | 2 +- .../Runtime/SuppressedErrorConstructor.cpp | 6 +-- .../Runtime/SuppressedErrorConstructor.h | 2 +- .../Runtime/SuppressedErrorPrototype.cpp | 8 ++-- .../LibJS/Runtime/SuppressedErrorPrototype.h | 2 +- .../LibJS/Runtime/SymbolConstructor.cpp | 6 +-- .../LibJS/Runtime/SymbolConstructor.h | 2 +- .../LibJS/Runtime/SymbolPrototype.cpp | 8 ++-- .../Libraries/LibJS/Runtime/SymbolPrototype.h | 2 +- .../Runtime/Temporal/CalendarConstructor.cpp | 6 +-- .../Runtime/Temporal/CalendarConstructor.h | 2 +- .../Runtime/Temporal/CalendarPrototype.cpp | 8 ++-- .../Runtime/Temporal/CalendarPrototype.h | 2 +- .../Runtime/Temporal/DurationConstructor.cpp | 6 +-- .../Runtime/Temporal/DurationConstructor.h | 2 +- .../Runtime/Temporal/DurationPrototype.cpp | 8 ++-- .../Runtime/Temporal/DurationPrototype.h | 2 +- .../Runtime/Temporal/InstantConstructor.cpp | 6 +-- .../Runtime/Temporal/InstantConstructor.h | 2 +- .../Runtime/Temporal/InstantPrototype.cpp | 8 ++-- .../LibJS/Runtime/Temporal/InstantPrototype.h | 2 +- .../Libraries/LibJS/Runtime/Temporal/Now.cpp | 8 ++-- .../Libraries/LibJS/Runtime/Temporal/Now.h | 2 +- .../Runtime/Temporal/PlainDateConstructor.cpp | 6 +-- .../Runtime/Temporal/PlainDateConstructor.h | 2 +- .../Runtime/Temporal/PlainDatePrototype.cpp | 8 ++-- .../Runtime/Temporal/PlainDatePrototype.h | 2 +- .../Temporal/PlainDateTimeConstructor.cpp | 6 +-- .../Temporal/PlainDateTimeConstructor.h | 2 +- .../Temporal/PlainDateTimePrototype.cpp | 8 ++-- .../Runtime/Temporal/PlainDateTimePrototype.h | 2 +- .../Temporal/PlainMonthDayConstructor.cpp | 6 +-- .../Temporal/PlainMonthDayConstructor.h | 2 +- .../Temporal/PlainMonthDayPrototype.cpp | 8 ++-- .../Runtime/Temporal/PlainMonthDayPrototype.h | 2 +- .../Runtime/Temporal/PlainTimeConstructor.cpp | 6 +-- .../Runtime/Temporal/PlainTimeConstructor.h | 2 +- .../Runtime/Temporal/PlainTimePrototype.cpp | 8 ++-- .../Runtime/Temporal/PlainTimePrototype.h | 2 +- .../Temporal/PlainYearMonthConstructor.cpp | 6 +-- .../Temporal/PlainYearMonthConstructor.h | 2 +- .../Temporal/PlainYearMonthPrototype.cpp | 8 ++-- .../Temporal/PlainYearMonthPrototype.h | 2 +- .../LibJS/Runtime/Temporal/Temporal.cpp | 10 ++--- .../LibJS/Runtime/Temporal/Temporal.h | 2 +- .../Runtime/Temporal/TimeZoneConstructor.cpp | 6 +-- .../Runtime/Temporal/TimeZoneConstructor.h | 2 +- .../Runtime/Temporal/TimeZonePrototype.cpp | 8 ++-- .../Runtime/Temporal/TimeZonePrototype.h | 2 +- .../Temporal/ZonedDateTimeConstructor.cpp | 6 +-- .../Temporal/ZonedDateTimeConstructor.h | 2 +- .../Temporal/ZonedDateTimePrototype.cpp | 8 ++-- .../Runtime/Temporal/ZonedDateTimePrototype.h | 2 +- .../Libraries/LibJS/Runtime/TypedArray.cpp | 12 ++---- Userland/Libraries/LibJS/Runtime/TypedArray.h | 4 +- .../LibJS/Runtime/TypedArrayConstructor.cpp | 6 +-- .../LibJS/Runtime/TypedArrayConstructor.h | 2 +- .../LibJS/Runtime/TypedArrayPrototype.cpp | 6 +-- .../LibJS/Runtime/TypedArrayPrototype.h | 2 +- .../LibJS/Runtime/WeakMapConstructor.cpp | 6 +-- .../LibJS/Runtime/WeakMapConstructor.h | 2 +- .../LibJS/Runtime/WeakMapPrototype.cpp | 6 +-- .../LibJS/Runtime/WeakMapPrototype.h | 2 +- .../LibJS/Runtime/WeakRefConstructor.cpp | 6 +-- .../LibJS/Runtime/WeakRefConstructor.h | 2 +- .../LibJS/Runtime/WeakRefPrototype.cpp | 6 +-- .../LibJS/Runtime/WeakRefPrototype.h | 2 +- .../LibJS/Runtime/WeakSetConstructor.cpp | 6 +-- .../LibJS/Runtime/WeakSetConstructor.h | 2 +- .../LibJS/Runtime/WeakSetPrototype.cpp | 6 +-- .../LibJS/Runtime/WeakSetPrototype.h | 2 +- .../Runtime/WrapForValidIteratorPrototype.cpp | 6 +-- .../Runtime/WrapForValidIteratorPrototype.h | 2 +- .../Libraries/LibTest/JavaScriptTestRunner.h | 8 ++-- .../LibWeb/Bindings/AudioConstructor.cpp | 6 +-- .../LibWeb/Bindings/AudioConstructor.h | 2 +- .../LibWeb/Bindings/ImageConstructor.cpp | 6 +-- .../LibWeb/Bindings/ImageConstructor.h | 2 +- .../LibWeb/Bindings/OptionConstructor.cpp | 6 +-- .../LibWeb/Bindings/OptionConstructor.h | 2 +- .../Libraries/LibWeb/CSS/CSSConditionRule.cpp | 6 +-- .../Libraries/LibWeb/CSS/CSSConditionRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSFontFaceRule.cpp | 6 +-- .../Libraries/LibWeb/CSS/CSSFontFaceRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSGroupingRule.cpp | 6 +-- .../Libraries/LibWeb/CSS/CSSGroupingRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSImportRule.cpp | 6 +-- Userland/Libraries/LibWeb/CSS/CSSImportRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSKeyframeRule.cpp | 5 +-- .../Libraries/LibWeb/CSS/CSSKeyframeRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSKeyframesRule.cpp | 6 +-- .../Libraries/LibWeb/CSS/CSSKeyframesRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSMediaRule.cpp | 6 +-- Userland/Libraries/LibWeb/CSS/CSSMediaRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSNamespaceRule.cpp | 6 +-- .../Libraries/LibWeb/CSS/CSSNamespaceRule.h | 2 +- Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp | 6 +-- Userland/Libraries/LibWeb/CSS/CSSRuleList.h | 2 +- .../LibWeb/CSS/CSSStyleDeclaration.cpp | 5 +-- .../LibWeb/CSS/CSSStyleDeclaration.h | 2 +- .../Libraries/LibWeb/CSS/CSSStyleRule.cpp | 6 +-- Userland/Libraries/LibWeb/CSS/CSSStyleRule.h | 2 +- .../Libraries/LibWeb/CSS/CSSStyleSheet.cpp | 6 +-- Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h | 2 +- .../Libraries/LibWeb/CSS/CSSSupportsRule.cpp | 6 +-- .../Libraries/LibWeb/CSS/CSSSupportsRule.h | 2 +- Userland/Libraries/LibWeb/CSS/MediaList.cpp | 6 +-- Userland/Libraries/LibWeb/CSS/MediaList.h | 2 +- .../Libraries/LibWeb/CSS/MediaQueryList.cpp | 6 +-- .../Libraries/LibWeb/CSS/MediaQueryList.h | 2 +- .../LibWeb/CSS/MediaQueryListEvent.cpp | 6 +-- .../LibWeb/CSS/MediaQueryListEvent.h | 2 +- Userland/Libraries/LibWeb/CSS/Screen.cpp | 6 +-- Userland/Libraries/LibWeb/CSS/Screen.h | 2 +- .../Libraries/LibWeb/CSS/StyleSheetList.cpp | 6 +-- .../Libraries/LibWeb/CSS/StyleSheetList.h | 2 +- .../Libraries/LibWeb/CSS/VisualViewport.cpp | 6 +-- .../Libraries/LibWeb/CSS/VisualViewport.h | 2 +- Userland/Libraries/LibWeb/Crypto/Crypto.cpp | 10 ++--- Userland/Libraries/LibWeb/Crypto/Crypto.h | 2 +- .../Libraries/LibWeb/Crypto/SubtleCrypto.cpp | 6 +-- .../Libraries/LibWeb/Crypto/SubtleCrypto.h | 2 +- .../Libraries/LibWeb/DOM/AbortController.cpp | 6 +-- .../Libraries/LibWeb/DOM/AbortController.h | 2 +- Userland/Libraries/LibWeb/DOM/AbortSignal.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/AbortSignal.h | 2 +- .../Libraries/LibWeb/DOM/AbstractRange.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/AbstractRange.h | 2 +- Userland/Libraries/LibWeb/DOM/Attr.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/Attr.h | 2 +- .../Libraries/LibWeb/DOM/CDATASection.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/CDATASection.h | 2 +- .../Libraries/LibWeb/DOM/CharacterData.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/CharacterData.h | 2 +- Userland/Libraries/LibWeb/DOM/Comment.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/Comment.h | 2 +- Userland/Libraries/LibWeb/DOM/CustomEvent.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/CustomEvent.h | 2 +- .../LibWeb/DOM/DOMImplementation.cpp | 6 +-- .../Libraries/LibWeb/DOM/DOMImplementation.h | 2 +- .../Libraries/LibWeb/DOM/DOMTokenList.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/DOMTokenList.h | 2 +- Userland/Libraries/LibWeb/DOM/Document.cpp | 10 ++--- Userland/Libraries/LibWeb/DOM/Document.h | 2 +- .../Libraries/LibWeb/DOM/DocumentFragment.cpp | 6 +-- .../Libraries/LibWeb/DOM/DocumentFragment.h | 2 +- .../Libraries/LibWeb/DOM/DocumentType.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/DocumentType.h | 2 +- Userland/Libraries/LibWeb/DOM/Element.cpp | 10 ++--- Userland/Libraries/LibWeb/DOM/Element.h | 2 +- Userland/Libraries/LibWeb/DOM/Event.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/Event.h | 2 +- Userland/Libraries/LibWeb/DOM/EventTarget.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/EventTarget.h | 2 +- .../Libraries/LibWeb/DOM/HTMLCollection.cpp | 6 +-- .../Libraries/LibWeb/DOM/HTMLCollection.h | 2 +- .../Libraries/LibWeb/DOM/MutationObserver.cpp | 6 +-- .../Libraries/LibWeb/DOM/MutationObserver.h | 2 +- .../Libraries/LibWeb/DOM/MutationRecord.cpp | 6 +-- .../Libraries/LibWeb/DOM/MutationRecord.h | 2 +- .../Libraries/LibWeb/DOM/NamedNodeMap.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/NamedNodeMap.h | 2 +- .../Libraries/LibWeb/DOM/NodeIterator.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/NodeIterator.h | 2 +- Userland/Libraries/LibWeb/DOM/NodeList.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/NodeList.h | 2 +- .../LibWeb/DOM/ProcessingInstruction.cpp | 6 +-- .../LibWeb/DOM/ProcessingInstruction.h | 2 +- Userland/Libraries/LibWeb/DOM/Range.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/Range.h | 2 +- Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp | 5 +-- Userland/Libraries/LibWeb/DOM/ShadowRoot.h | 2 +- Userland/Libraries/LibWeb/DOM/StaticRange.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/StaticRange.h | 2 +- Userland/Libraries/LibWeb/DOM/Text.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/Text.h | 2 +- Userland/Libraries/LibWeb/DOM/TreeWalker.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/TreeWalker.h | 2 +- Userland/Libraries/LibWeb/DOM/XMLDocument.cpp | 6 +-- Userland/Libraries/LibWeb/DOM/XMLDocument.h | 2 +- .../LibWeb/DOMParsing/XMLSerializer.cpp | 6 +-- .../LibWeb/DOMParsing/XMLSerializer.h | 2 +- .../Libraries/LibWeb/Encoding/TextDecoder.cpp | 6 +-- .../Libraries/LibWeb/Encoding/TextDecoder.h | 2 +- .../Libraries/LibWeb/Encoding/TextEncoder.cpp | 6 +-- .../Libraries/LibWeb/Encoding/TextEncoder.h | 2 +- Userland/Libraries/LibWeb/Fetch/Headers.cpp | 6 +-- Userland/Libraries/LibWeb/Fetch/Headers.h | 2 +- .../LibWeb/Fetch/HeadersIterator.cpp | 6 +-- .../Libraries/LibWeb/Fetch/HeadersIterator.h | 2 +- Userland/Libraries/LibWeb/Fetch/Request.cpp | 6 +-- Userland/Libraries/LibWeb/Fetch/Request.h | 2 +- Userland/Libraries/LibWeb/Fetch/Response.cpp | 6 +-- Userland/Libraries/LibWeb/Fetch/Response.h | 2 +- Userland/Libraries/LibWeb/FileAPI/Blob.cpp | 6 +-- Userland/Libraries/LibWeb/FileAPI/Blob.h | 2 +- Userland/Libraries/LibWeb/FileAPI/File.cpp | 6 +-- Userland/Libraries/LibWeb/FileAPI/File.h | 2 +- .../Libraries/LibWeb/FileAPI/FileList.cpp | 6 +-- Userland/Libraries/LibWeb/FileAPI/FileList.h | 2 +- .../Libraries/LibWeb/Geometry/DOMMatrix.cpp | 6 +-- .../Libraries/LibWeb/Geometry/DOMMatrix.h | 2 +- .../LibWeb/Geometry/DOMMatrixReadOnly.cpp | 6 +-- .../LibWeb/Geometry/DOMMatrixReadOnly.h | 2 +- .../Libraries/LibWeb/Geometry/DOMPoint.cpp | 6 +-- Userland/Libraries/LibWeb/Geometry/DOMPoint.h | 2 +- .../LibWeb/Geometry/DOMPointReadOnly.cpp | 6 +-- .../LibWeb/Geometry/DOMPointReadOnly.h | 2 +- .../Libraries/LibWeb/Geometry/DOMRect.cpp | 6 +-- Userland/Libraries/LibWeb/Geometry/DOMRect.h | 2 +- .../Libraries/LibWeb/Geometry/DOMRectList.cpp | 6 +-- .../Libraries/LibWeb/Geometry/DOMRectList.h | 2 +- .../LibWeb/Geometry/DOMRectReadOnly.cpp | 6 +-- .../LibWeb/Geometry/DOMRectReadOnly.h | 2 +- Userland/Libraries/LibWeb/HTML/AudioTrack.cpp | 8 ++-- Userland/Libraries/LibWeb/HTML/AudioTrack.h | 2 +- .../Libraries/LibWeb/HTML/AudioTrackList.cpp | 6 +-- .../Libraries/LibWeb/HTML/AudioTrackList.h | 2 +- .../Libraries/LibWeb/HTML/CanvasGradient.cpp | 6 +-- .../Libraries/LibWeb/HTML/CanvasGradient.h | 2 +- .../Libraries/LibWeb/HTML/CanvasPattern.cpp | 6 +-- .../Libraries/LibWeb/HTML/CanvasPattern.h | 2 +- .../LibWeb/HTML/CanvasRenderingContext2D.cpp | 6 +-- .../LibWeb/HTML/CanvasRenderingContext2D.h | 2 +- Userland/Libraries/LibWeb/HTML/CloseEvent.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/CloseEvent.h | 2 +- .../CustomElements/CustomElementRegistry.cpp | 6 +-- .../CustomElements/CustomElementRegistry.h | 2 +- Userland/Libraries/LibWeb/HTML/DOMParser.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/DOMParser.h | 2 +- .../Libraries/LibWeb/HTML/DOMStringMap.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/DOMStringMap.h | 2 +- Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/ErrorEvent.h | 2 +- .../Libraries/LibWeb/HTML/FormDataEvent.cpp | 6 +-- .../Libraries/LibWeb/HTML/FormDataEvent.h | 2 +- .../LibWeb/HTML/HTMLAnchorElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLAnchorElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLAreaElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLAreaElement.h | 2 +- .../LibWeb/HTML/HTMLAudioElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLAudioElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLBRElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLBRElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLBaseElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLBaseElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLBodyElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLBodyElement.h | 2 +- .../LibWeb/HTML/HTMLButtonElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLButtonElement.h | 2 +- .../LibWeb/HTML/HTMLCanvasElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLCanvasElement.h | 2 +- .../LibWeb/HTML/HTMLDListElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLDListElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLDataElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLDataElement.h | 2 +- .../LibWeb/HTML/HTMLDataListElement.cpp | 6 +-- .../LibWeb/HTML/HTMLDataListElement.h | 2 +- .../LibWeb/HTML/HTMLDetailsElement.cpp | 6 +-- .../LibWeb/HTML/HTMLDetailsElement.h | 2 +- .../LibWeb/HTML/HTMLDialogElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLDialogElement.h | 2 +- .../LibWeb/HTML/HTMLDirectoryElement.cpp | 6 +-- .../LibWeb/HTML/HTMLDirectoryElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLDivElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLDivElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLElement.cpp | 10 ++--- Userland/Libraries/LibWeb/HTML/HTMLElement.h | 2 +- .../LibWeb/HTML/HTMLEmbedElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLEmbedElement.h | 2 +- .../LibWeb/HTML/HTMLFieldSetElement.cpp | 6 +-- .../LibWeb/HTML/HTMLFieldSetElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLFontElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLFontElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLFormElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLFormElement.h | 2 +- .../LibWeb/HTML/HTMLFrameElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLFrameElement.h | 2 +- .../LibWeb/HTML/HTMLFrameSetElement.cpp | 6 +-- .../LibWeb/HTML/HTMLFrameSetElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLHRElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLHRElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLHeadElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLHeadElement.h | 2 +- .../LibWeb/HTML/HTMLHeadingElement.cpp | 6 +-- .../LibWeb/HTML/HTMLHeadingElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLHtmlElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLHtmlElement.h | 2 +- .../LibWeb/HTML/HTMLIFrameElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLIFrameElement.h | 2 +- .../LibWeb/HTML/HTMLImageElement.cpp | 8 ++-- .../Libraries/LibWeb/HTML/HTMLImageElement.h | 2 +- .../LibWeb/HTML/HTMLInputElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLInputElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLLIElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLLIElement.h | 2 +- .../LibWeb/HTML/HTMLLabelElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLLabelElement.h | 2 +- .../LibWeb/HTML/HTMLLegendElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLLegendElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLLinkElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLMapElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLMapElement.h | 2 +- .../LibWeb/HTML/HTMLMarqueeElement.cpp | 6 +-- .../LibWeb/HTML/HTMLMarqueeElement.h | 2 +- .../LibWeb/HTML/HTMLMediaElement.cpp | 12 +++--- .../Libraries/LibWeb/HTML/HTMLMediaElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLMenuElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLMenuElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLMetaElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLMetaElement.h | 2 +- .../LibWeb/HTML/HTMLMeterElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLMeterElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLModElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLModElement.h | 2 +- .../LibWeb/HTML/HTMLOListElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLOListElement.h | 2 +- .../LibWeb/HTML/HTMLObjectElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLObjectElement.h | 2 +- .../LibWeb/HTML/HTMLOptGroupElement.cpp | 6 +-- .../LibWeb/HTML/HTMLOptGroupElement.h | 2 +- .../LibWeb/HTML/HTMLOptionElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLOptionElement.h | 2 +- .../LibWeb/HTML/HTMLOptionsCollection.cpp | 6 +-- .../LibWeb/HTML/HTMLOptionsCollection.h | 2 +- .../LibWeb/HTML/HTMLOutputElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLOutputElement.h | 2 +- .../LibWeb/HTML/HTMLParagraphElement.cpp | 6 +-- .../LibWeb/HTML/HTMLParagraphElement.h | 2 +- .../LibWeb/HTML/HTMLParamElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLParamElement.h | 2 +- .../LibWeb/HTML/HTMLPictureElement.cpp | 6 +-- .../LibWeb/HTML/HTMLPictureElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLPreElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLPreElement.h | 2 +- .../LibWeb/HTML/HTMLProgressElement.cpp | 6 +-- .../LibWeb/HTML/HTMLProgressElement.h | 2 +- .../LibWeb/HTML/HTMLQuoteElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLQuoteElement.h | 2 +- .../LibWeb/HTML/HTMLScriptElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLScriptElement.h | 2 +- .../LibWeb/HTML/HTMLSelectElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLSelectElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLSlotElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLSlotElement.h | 2 +- .../LibWeb/HTML/HTMLSourceElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLSourceElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLSpanElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLSpanElement.h | 2 +- .../LibWeb/HTML/HTMLStyleElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLStyleElement.h | 2 +- .../LibWeb/HTML/HTMLSummaryElement.cpp | 6 +-- .../LibWeb/HTML/HTMLSummaryElement.h | 2 +- .../LibWeb/HTML/HTMLTableCaptionElement.cpp | 6 +-- .../LibWeb/HTML/HTMLTableCaptionElement.h | 2 +- .../LibWeb/HTML/HTMLTableCellElement.cpp | 6 +-- .../LibWeb/HTML/HTMLTableCellElement.h | 2 +- .../LibWeb/HTML/HTMLTableColElement.cpp | 6 +-- .../LibWeb/HTML/HTMLTableColElement.h | 2 +- .../LibWeb/HTML/HTMLTableElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLTableElement.h | 2 +- .../LibWeb/HTML/HTMLTableRowElement.cpp | 6 +-- .../LibWeb/HTML/HTMLTableRowElement.h | 2 +- .../LibWeb/HTML/HTMLTableSectionElement.cpp | 6 +-- .../LibWeb/HTML/HTMLTableSectionElement.h | 2 +- .../LibWeb/HTML/HTMLTemplateElement.cpp | 8 ++-- .../LibWeb/HTML/HTMLTemplateElement.h | 2 +- .../LibWeb/HTML/HTMLTextAreaElement.cpp | 6 +-- .../LibWeb/HTML/HTMLTextAreaElement.h | 2 +- .../Libraries/LibWeb/HTML/HTMLTimeElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLTimeElement.h | 2 +- .../LibWeb/HTML/HTMLTitleElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLTitleElement.h | 2 +- .../LibWeb/HTML/HTMLTrackElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLTrackElement.h | 2 +- .../LibWeb/HTML/HTMLUListElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLUListElement.h | 2 +- .../LibWeb/HTML/HTMLUnknownElement.cpp | 6 +-- .../LibWeb/HTML/HTMLUnknownElement.h | 2 +- .../LibWeb/HTML/HTMLVideoElement.cpp | 6 +-- .../Libraries/LibWeb/HTML/HTMLVideoElement.h | 2 +- Userland/Libraries/LibWeb/HTML/History.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/History.h | 2 +- Userland/Libraries/LibWeb/HTML/ImageData.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/ImageData.h | 2 +- Userland/Libraries/LibWeb/HTML/Location.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/Location.h | 2 +- Userland/Libraries/LibWeb/HTML/MediaError.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/MediaError.h | 2 +- .../Libraries/LibWeb/HTML/MessageChannel.cpp | 6 +-- .../Libraries/LibWeb/HTML/MessageChannel.h | 2 +- .../Libraries/LibWeb/HTML/MessageEvent.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/MessageEvent.h | 2 +- .../Libraries/LibWeb/HTML/MessagePort.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/MessagePort.h | 2 +- Userland/Libraries/LibWeb/HTML/MimeType.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/MimeType.h | 2 +- .../Libraries/LibWeb/HTML/MimeTypeArray.cpp | 6 +-- .../Libraries/LibWeb/HTML/MimeTypeArray.h | 2 +- Userland/Libraries/LibWeb/HTML/Navigator.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/Navigator.h | 2 +- .../LibWeb/HTML/PageTransitionEvent.cpp | 6 +-- .../LibWeb/HTML/PageTransitionEvent.h | 2 +- Userland/Libraries/LibWeb/HTML/Path2D.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/Path2D.h | 2 +- Userland/Libraries/LibWeb/HTML/Plugin.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/Plugin.h | 2 +- .../Libraries/LibWeb/HTML/PluginArray.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/PluginArray.h | 2 +- .../LibWeb/HTML/PromiseRejectionEvent.cpp | 6 +-- .../LibWeb/HTML/PromiseRejectionEvent.h | 2 +- .../LibWeb/HTML/Scripting/Environments.cpp | 5 +-- .../LibWeb/HTML/Scripting/Environments.h | 2 +- Userland/Libraries/LibWeb/HTML/Storage.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/Storage.h | 2 +- .../Libraries/LibWeb/HTML/SubmitEvent.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/SubmitEvent.h | 2 +- .../Libraries/LibWeb/HTML/TextMetrics.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/TextMetrics.h | 2 +- Userland/Libraries/LibWeb/HTML/TimeRanges.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/TimeRanges.h | 2 +- Userland/Libraries/LibWeb/HTML/TrackEvent.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/TrackEvent.h | 2 +- Userland/Libraries/LibWeb/HTML/VideoTrack.cpp | 8 ++-- Userland/Libraries/LibWeb/HTML/VideoTrack.h | 2 +- .../Libraries/LibWeb/HTML/VideoTrackList.cpp | 6 +-- .../Libraries/LibWeb/HTML/VideoTrackList.h | 2 +- Userland/Libraries/LibWeb/HTML/Window.cpp | 4 +- .../LibWeb/HTML/WindowOrWorkerGlobalScope.cpp | 21 ++++------ .../LibWeb/HTML/WindowOrWorkerGlobalScope.h | 2 +- Userland/Libraries/LibWeb/HTML/Worker.cpp | 6 +-- Userland/Libraries/LibWeb/HTML/Worker.h | 2 +- .../LibWeb/HTML/WorkerGlobalScope.cpp | 10 ++--- .../Libraries/LibWeb/HTML/WorkerGlobalScope.h | 2 +- .../Libraries/LibWeb/HTML/WorkerNavigator.cpp | 6 +-- .../Libraries/LibWeb/HTML/WorkerNavigator.h | 2 +- .../LibWeb/HighResolutionTime/Performance.cpp | 6 +-- .../LibWeb/HighResolutionTime/Performance.h | 2 +- .../Libraries/LibWeb/Internals/Internals.cpp | 5 +-- .../Libraries/LibWeb/Internals/Internals.h | 2 +- .../IntersectionObserver.cpp | 6 +-- .../IntersectionObserver.h | 2 +- .../IntersectionObserverEntry.cpp | 6 +-- .../IntersectionObserverEntry.h | 2 +- .../NavigationTiming/PerformanceTiming.cpp | 6 +-- .../NavigationTiming/PerformanceTiming.h | 2 +- .../PerformanceTimeline/PerformanceEntry.cpp | 6 +-- .../PerformanceTimeline/PerformanceEntry.h | 2 +- .../RequestIdleCallback/IdleDeadline.cpp | 6 +-- .../LibWeb/RequestIdleCallback/IdleDeadline.h | 2 +- .../LibWeb/ResizeObserver/ResizeObserver.cpp | 6 +-- .../LibWeb/ResizeObserver/ResizeObserver.h | 2 +- .../LibWeb/SVG/SVGAnimatedLength.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGAnimatedLength.h | 2 +- .../LibWeb/SVG/SVGAnimatedNumber.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGAnimatedNumber.h | 2 +- .../Libraries/LibWeb/SVG/SVGCircleElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGCircleElement.h | 2 +- .../LibWeb/SVG/SVGClipPathElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGClipPathElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGDefsElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGDefsElement.h | 2 +- Userland/Libraries/LibWeb/SVG/SVGElement.cpp | 10 ++--- Userland/Libraries/LibWeb/SVG/SVGElement.h | 2 +- .../LibWeb/SVG/SVGEllipseElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGEllipseElement.h | 2 +- .../LibWeb/SVG/SVGForeignObjectElement.cpp | 24 +++-------- .../LibWeb/SVG/SVGForeignObjectElement.h | 2 +- .../LibWeb/SVG/SVGGeometryElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGGeometryElement.h | 2 +- .../LibWeb/SVG/SVGGradientElement.cpp | 5 +-- .../Libraries/LibWeb/SVG/SVGGradientElement.h | 2 +- .../LibWeb/SVG/SVGGraphicsElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGGraphicsElement.h | 2 +- Userland/Libraries/LibWeb/SVG/SVGLength.cpp | 6 +-- Userland/Libraries/LibWeb/SVG/SVGLength.h | 2 +- .../Libraries/LibWeb/SVG/SVGLineElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGLineElement.h | 2 +- .../LibWeb/SVG/SVGLinearGradientElement.cpp | 6 +-- .../LibWeb/SVG/SVGLinearGradientElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGPathElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGPathElement.h | 2 +- .../LibWeb/SVG/SVGPolygonElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGPolygonElement.h | 2 +- .../LibWeb/SVG/SVGPolylineElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGPolylineElement.h | 2 +- .../LibWeb/SVG/SVGRadialGradientElement.cpp | 6 +-- .../LibWeb/SVG/SVGRadialGradientElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGRectElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGRectElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGSVGElement.cpp | 6 +-- Userland/Libraries/LibWeb/SVG/SVGSVGElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGStopElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGStopElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGStyleElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGStyleElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGSymbolElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGSymbolElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGTSpanElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGTSpanElement.h | 2 +- .../LibWeb/SVG/SVGTextContentElement.cpp | 6 +-- .../LibWeb/SVG/SVGTextContentElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGTextElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGTextElement.h | 2 +- .../LibWeb/SVG/SVGTextPositioningElement.cpp | 6 +-- .../LibWeb/SVG/SVGTextPositioningElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGTitleElement.cpp | 6 +-- .../Libraries/LibWeb/SVG/SVGTitleElement.h | 2 +- .../Libraries/LibWeb/SVG/SVGUseElement.cpp | 10 ++--- Userland/Libraries/LibWeb/SVG/SVGUseElement.h | 2 +- .../Libraries/LibWeb/Selection/Selection.cpp | 6 +-- .../Libraries/LibWeb/Selection/Selection.h | 2 +- .../Streams/ByteLengthQueuingStrategy.cpp | 6 +-- .../Streams/ByteLengthQueuingStrategy.h | 2 +- .../LibWeb/Streams/CountQueuingStrategy.cpp | 6 +-- .../LibWeb/Streams/CountQueuingStrategy.h | 2 +- .../LibWeb/Streams/ReadableStream.cpp | 6 +-- .../Libraries/LibWeb/Streams/ReadableStream.h | 2 +- .../ReadableStreamDefaultController.cpp | 6 +-- .../Streams/ReadableStreamDefaultController.h | 2 +- .../Streams/ReadableStreamDefaultReader.cpp | 6 +-- .../Streams/ReadableStreamDefaultReader.h | 2 +- .../LibWeb/Streams/TransformStream.cpp | 6 +-- .../LibWeb/Streams/TransformStream.h | 2 +- .../TransformStreamDefaultController.cpp | 6 +-- .../TransformStreamDefaultController.h | 2 +- .../LibWeb/Streams/WritableStream.cpp | 6 +-- .../Libraries/LibWeb/Streams/WritableStream.h | 2 +- .../Streams/WritableStreamDefaultWriter.cpp | 6 +-- .../Streams/WritableStreamDefaultWriter.h | 2 +- .../Libraries/LibWeb/UIEvents/FocusEvent.cpp | 6 +-- .../Libraries/LibWeb/UIEvents/FocusEvent.h | 2 +- .../LibWeb/UIEvents/KeyboardEvent.cpp | 6 +-- .../Libraries/LibWeb/UIEvents/KeyboardEvent.h | 2 +- .../Libraries/LibWeb/UIEvents/MouseEvent.cpp | 6 +-- .../Libraries/LibWeb/UIEvents/MouseEvent.h | 2 +- .../Libraries/LibWeb/UIEvents/UIEvent.cpp | 6 +-- Userland/Libraries/LibWeb/UIEvents/UIEvent.h | 2 +- .../Libraries/LibWeb/UIEvents/WheelEvent.cpp | 6 +-- .../Libraries/LibWeb/UIEvents/WheelEvent.h | 2 +- Userland/Libraries/LibWeb/URL/URL.cpp | 6 +-- Userland/Libraries/LibWeb/URL/URL.h | 2 +- .../Libraries/LibWeb/URL/URLSearchParams.cpp | 6 +-- .../Libraries/LibWeb/URL/URLSearchParams.h | 2 +- .../LibWeb/URL/URLSearchParamsIterator.cpp | 6 +-- .../LibWeb/URL/URLSearchParamsIterator.h | 2 +- .../LibWeb/UserTiming/PerformanceMark.cpp | 6 +-- .../LibWeb/UserTiming/PerformanceMark.h | 2 +- .../LibWeb/UserTiming/PerformanceMeasure.cpp | 6 +-- .../LibWeb/UserTiming/PerformanceMeasure.h | 2 +- .../Libraries/LibWeb/WebAssembly/Instance.cpp | 25 +++++------ .../Libraries/LibWeb/WebAssembly/Instance.h | 2 +- .../Libraries/LibWeb/WebAssembly/Memory.cpp | 6 +-- .../Libraries/LibWeb/WebAssembly/Memory.h | 2 +- .../Libraries/LibWeb/WebAssembly/Module.cpp | 6 +-- .../Libraries/LibWeb/WebAssembly/Module.h | 2 +- .../Libraries/LibWeb/WebAssembly/Table.cpp | 6 +-- Userland/Libraries/LibWeb/WebAssembly/Table.h | 2 +- .../LibWeb/WebAudio/AudioContext.cpp | 6 +-- .../Libraries/LibWeb/WebAudio/AudioContext.h | 2 +- .../LibWeb/WebAudio/BaseAudioContext.cpp | 6 +-- .../LibWeb/WebAudio/BaseAudioContext.h | 2 +- .../LibWeb/WebGL/WebGLContextEvent.cpp | 6 +-- .../LibWeb/WebGL/WebGLContextEvent.h | 2 +- .../LibWeb/WebGL/WebGLRenderingContext.cpp | 6 +-- .../LibWeb/WebGL/WebGLRenderingContext.h | 2 +- .../Libraries/LibWeb/WebIDL/DOMException.cpp | 6 +-- .../Libraries/LibWeb/WebIDL/DOMException.h | 2 +- .../Libraries/LibWeb/WebSockets/WebSocket.cpp | 6 +-- .../Libraries/LibWeb/WebSockets/WebSocket.h | 2 +- Userland/Libraries/LibWeb/XHR/FormData.cpp | 6 +-- Userland/Libraries/LibWeb/XHR/FormData.h | 2 +- .../Libraries/LibWeb/XHR/FormDataIterator.cpp | 6 +-- .../Libraries/LibWeb/XHR/FormDataIterator.h | 2 +- .../Libraries/LibWeb/XHR/ProgressEvent.cpp | 6 +-- Userland/Libraries/LibWeb/XHR/ProgressEvent.h | 2 +- .../Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 6 +-- .../Libraries/LibWeb/XHR/XMLHttpRequest.h | 2 +- .../LibWeb/XHR/XMLHttpRequestUpload.cpp | 6 +-- .../LibWeb/XHR/XMLHttpRequestUpload.h | 2 +- .../ConsoleGlobalEnvironmentExtensions.cpp | 6 +-- .../ConsoleGlobalEnvironmentExtensions.h | 2 +- Userland/Utilities/js.cpp | 16 +++---- 804 files changed, 1330 insertions(+), 2171 deletions(-) diff --git a/Meta/Lagom/Fuzzers/FuzzilliJs.cpp b/Meta/Lagom/Fuzzers/FuzzilliJs.cpp index e66b285c2f..d0192959b8 100644 --- a/Meta/Lagom/Fuzzers/FuzzilliJs.cpp +++ b/Meta/Lagom/Fuzzers/FuzzilliJs.cpp @@ -120,7 +120,7 @@ class TestRunnerGlobalObject final : public JS::GlobalObject { public: TestRunnerGlobalObject(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~TestRunnerGlobalObject() override; private: @@ -167,13 +167,11 @@ JS_DEFINE_NATIVE_FUNCTION(TestRunnerGlobalObject::fuzzilli) return JS::js_undefined(); } -JS::ThrowCompletionOr TestRunnerGlobalObject::initialize(JS::Realm& realm) +void TestRunnerGlobalObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property("global", this, JS::Attribute::Enumerable); define_native_function(realm, "fuzzilli", fuzzilli, 2, JS::default_attributes); - - return {}; } int main(int, char**) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 830f86d3d3..f26f1aee36 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -2540,12 +2540,12 @@ static void generate_prototype_or_global_mixin_definitions(IDL::Interface const& #define define_native_function (object.define_native_function) #define set_prototype (object.set_prototype) -JS::ThrowCompletionOr @class_name@::initialize(JS::Realm& realm, JS::Object& object) +void @class_name@::initialize(JS::Realm& realm, JS::Object& object) { )~~~"); } else { generator.append(R"~~~( -JS::ThrowCompletionOr @class_name@::initialize(JS::Realm& realm) +void @class_name@::initialize(JS::Realm& realm) { )~~~"); } @@ -2682,17 +2682,16 @@ JS::ThrowCompletionOr @class_name@::initialize(JS::Realm& realm) } generator.append(R"~~~( - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(JS::PrimitiveString::create(vm, "@namespaced_name@"sv)), JS::Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(JS::PrimitiveString::create(vm, "@namespaced_name@"sv)), JS::Attribute::Configurable); )~~~"); if (!is_global_interface) { generator.append(R"~~~( - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); )~~~"); } generator.append(R"~~~( - return {}; } )~~~"); @@ -3051,7 +3050,7 @@ class @namespace_class@ final : public JS::Object { public: explicit @namespace_class@(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~@namespace_class@() override; private: @@ -3151,12 +3150,12 @@ namespace Web::Bindings { { } -JS::ThrowCompletionOr @namespace_class@::initialize(JS::Realm& realm) +void @namespace_class@::initialize(JS::Realm& realm) { [[maybe_unused]] auto& vm = this->vm(); [[maybe_unused]] u8 default_attributes = JS::Attribute::Enumerable; - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); )~~~"); @@ -3173,7 +3172,6 @@ JS::ThrowCompletionOr @namespace_class@::initialize(JS::Realm& realm) } generator.append(R"~~~( - return {}; } )~~~"); @@ -3217,7 +3215,7 @@ class @constructor_class@ : public JS::NativeFunction { JS_OBJECT(@constructor_class@, JS::NativeFunction); public: explicit @constructor_class@(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~@constructor_class@() override; virtual JS::ThrowCompletionOr call() override; @@ -3546,12 +3544,12 @@ JS::ThrowCompletionOr> @constructor_class@::constru generator.append(R"~~~( } -JS::ThrowCompletionOr @constructor_class@::initialize(JS::Realm& realm) +void @constructor_class@::initialize(JS::Realm& realm) { auto& vm = this->vm(); [[maybe_unused]] u8 default_attributes = JS::Attribute::Enumerable; - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property(vm.names.prototype, &ensure_web_prototype<@prototype_class@>(realm, "@namespaced_name@"), 0); define_direct_property(vm.names.length, JS::Value(@constructor.length@), JS::Attribute::Configurable); @@ -3581,7 +3579,6 @@ JS::ThrowCompletionOr @constructor_class@::initialize(JS::Realm& realm) } generator.append(R"~~~( - return {}; } )~~~"); @@ -3616,7 +3613,7 @@ class @prototype_class@ : public JS::Object { JS_OBJECT(@prototype_class@, JS::Object); public: explicit @prototype_class@(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~@prototype_class@() override; private: )~~~"); @@ -3776,10 +3773,9 @@ namespace Web::Bindings { auto is_global_interface = interface.extended_attributes.contains("Global"); if (is_global_interface) { generator.append(R"~~~( -JS::ThrowCompletionOr @prototype_class@::initialize(JS::Realm& realm) +void @prototype_class@::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); - return {}; + Base::initialize(realm); } )~~~"); } else { @@ -3809,7 +3805,7 @@ class @prototype_class@ : public JS::Object { JS_OBJECT(@prototype_class@, JS::Object); public: explicit @prototype_class@(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~@prototype_class@() override; private: @@ -3887,14 +3883,12 @@ namespace Web::Bindings { { } -JS::ThrowCompletionOr @prototype_class@::initialize(JS::Realm& realm) +void @prototype_class@::initialize(JS::Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_function(realm, vm.names.next, next, 0, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable); - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(JS::PrimitiveString::create(vm, "Iterator"sv)), JS::Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(JS::PrimitiveString::create(vm, "Iterator"sv)), JS::Attribute::Configurable); } static JS::ThrowCompletionOr<@fully_qualified_name@*> impl_from(JS::VM& vm) @@ -3930,7 +3924,7 @@ namespace Web::Bindings { class @class_name@ { public: - JS::ThrowCompletionOr initialize(JS::Realm&, JS::Object&); + void initialize(JS::Realm&, JS::Object&); @class_name@(); virtual ~@class_name@(); diff --git a/Meta/Lagom/Wasm/js_repl.cpp b/Meta/Lagom/Wasm/js_repl.cpp index 955485d837..7e43b67439 100644 --- a/Meta/Lagom/Wasm/js_repl.cpp +++ b/Meta/Lagom/Wasm/js_repl.cpp @@ -93,7 +93,7 @@ public: : GlobalObject(realm) { } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~ReplObject() override = default; private: @@ -211,9 +211,9 @@ static ErrorOr parse_and_run(JS::Interpreter& interpreter, StringView sour return true; } -JS::ThrowCompletionOr ReplObject::initialize(JS::Realm& realm) +void ReplObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property("global", this, JS::Attribute::Enumerable); u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable; @@ -238,8 +238,6 @@ JS::ThrowCompletionOr ReplObject::initialize(JS::Realm& realm) return value; }, attr); - - return {}; } JS_DEFINE_NATIVE_FUNCTION(ReplObject::print) diff --git a/Tests/LibWasm/test-wasm.cpp b/Tests/LibWasm/test-wasm.cpp index 5b7ce5cf53..4466309c08 100644 --- a/Tests/LibWasm/test-wasm.cpp +++ b/Tests/LibWasm/test-wasm.cpp @@ -70,7 +70,7 @@ public: instance->m_module_instance = result.release_value(); return instance.ptr(); } - JS::ThrowCompletionOr initialize(JS::Realm&) override; + void initialize(JS::Realm&) override; ~WebAssemblyModule() override = default; @@ -148,13 +148,11 @@ TESTJS_GLOBAL_FUNCTION(compare_typed_arrays, compareTypedArrays) return JS::Value(lhs_array.viewed_array_buffer()->buffer() == rhs_array.viewed_array_buffer()->buffer()); } -JS::ThrowCompletionOr WebAssemblyModule::initialize(JS::Realm& realm) +void WebAssemblyModule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_function(realm, "getExport", get_export, 1, JS::default_attributes); define_native_function(realm, "invoke", wasm_invoke, 1, JS::default_attributes); - - return {}; } JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::get_export) diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp index 8ee5666643..ee01b1e39b 100644 --- a/Userland/Applications/Spreadsheet/JSIntegration.cpp +++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp @@ -144,9 +144,9 @@ JS::ThrowCompletionOr SheetGlobalObject::internal_set(const JS::PropertyKe return Base::internal_set(property_name, value, receiver); } -JS::ThrowCompletionOr SheetGlobalObject::initialize(JS::Realm& realm) +void SheetGlobalObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable; define_native_function(realm, "get_real_cell_contents", get_real_cell_contents, 1, attr); @@ -157,8 +157,6 @@ JS::ThrowCompletionOr SheetGlobalObject::initialize(JS::Realm& realm) define_native_function(realm, "column_index", column_index, 1, attr); define_native_function(realm, "get_column_bound", get_column_bound, 1, attr); define_native_accessor(realm, "name", get_name, nullptr, attr); - - return {}; } void SheetGlobalObject::visit_edges(Visitor& visitor) @@ -378,12 +376,10 @@ WorkbookObject::WorkbookObject(JS::Realm& realm, Workbook& workbook) { } -JS::ThrowCompletionOr WorkbookObject::initialize(JS::Realm& realm) +void WorkbookObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Object::initialize(realm)); + Base::initialize(realm); define_native_function(realm, "sheet", sheet, 1, JS::default_attributes); - - return {}; } void WorkbookObject::visit_edges(Visitor& visitor) diff --git a/Userland/Applications/Spreadsheet/JSIntegration.h b/Userland/Applications/Spreadsheet/JSIntegration.h index ac529b77e2..586d55c8f9 100644 --- a/Userland/Applications/Spreadsheet/JSIntegration.h +++ b/Userland/Applications/Spreadsheet/JSIntegration.h @@ -24,7 +24,7 @@ class SheetGlobalObject final : public JS::GlobalObject { public: SheetGlobalObject(JS::Realm&, Sheet&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~SheetGlobalObject() override = default; virtual JS::ThrowCompletionOr internal_has_property(JS::PropertyKey const& name) const override; @@ -53,7 +53,7 @@ public: virtual ~WorkbookObject() override = default; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; JS_DECLARE_NATIVE_FUNCTION(sheet); diff --git a/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp b/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp index 0a00b4e11e..d71bdf952f 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/262Object.cpp @@ -27,12 +27,12 @@ $262Object::$262Object(Realm& realm) { } -ThrowCompletionOr $262Object::initialize(Realm& realm) +void $262Object::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); - m_agent = MUST_OR_THROW_OOM(vm().heap().allocate(realm, realm)); - m_is_htmldda = MUST_OR_THROW_OOM(vm().heap().allocate(realm, realm)); + m_agent = MUST(vm().heap().allocate(realm, realm)); + m_is_htmldda = MUST(vm().heap().allocate(realm, realm)); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, "clearKeptObjects", clear_kept_objects, 0, attr); @@ -44,8 +44,6 @@ ThrowCompletionOr $262Object::initialize(Realm& realm) define_direct_property("gc", realm.global_object().get_without_side_effects("gc"), attr); define_direct_property("global", &realm.global_object(), attr); define_direct_property("IsHTMLDDA", m_is_htmldda, attr); - - return {}; } void $262Object::visit_edges(Cell::Visitor& visitor) @@ -68,7 +66,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm) VERIFY(realm_global_object); realm->set_global_object(realm_global_object, nullptr); set_default_global_bindings(*realm); - MUST_OR_THROW_OOM(realm_global_object->initialize(*realm)); + realm_global_object->initialize(*realm); return Value(realm_global_object->$262()); } diff --git a/Userland/Libraries/LibJS/Contrib/Test262/262Object.h b/Userland/Libraries/LibJS/Contrib/Test262/262Object.h index 2305b1c899..9744576bd8 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/262Object.h +++ b/Userland/Libraries/LibJS/Contrib/Test262/262Object.h @@ -17,7 +17,7 @@ class $262Object final : public Object { JS_OBJECT($262Object, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~$262Object() override = default; private: diff --git a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp index a5904babea..910054e2d5 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.cpp @@ -17,9 +17,9 @@ AgentObject::AgentObject(Realm& realm) { } -JS::ThrowCompletionOr AgentObject::initialize(JS::Realm& realm) +void AgentObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, "monotonicNow", monotonic_now, 0, attr); @@ -27,8 +27,6 @@ JS::ThrowCompletionOr AgentObject::initialize(JS::Realm& realm) // TODO: broadcast // TODO: getReport // TODO: start - - return {}; } JS_DEFINE_NATIVE_FUNCTION(AgentObject::monotonic_now) diff --git a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h index fe84604096..8810b4751c 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h +++ b/Userland/Libraries/LibJS/Contrib/Test262/AgentObject.h @@ -15,7 +15,7 @@ class AgentObject final : public Object { JS_OBJECT(AgentObject, Object); public: - virtual JS::ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AgentObject() override = default; private: diff --git a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp index 1e104bf8d8..87be56cf3d 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp @@ -14,18 +14,16 @@ namespace JS::Test262 { -ThrowCompletionOr GlobalObject::initialize(Realm& realm) +void GlobalObject::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); - m_$262 = MUST_OR_THROW_OOM(vm().heap().allocate<$262Object>(realm, realm)); + m_$262 = MUST(vm().heap().allocate<$262Object>(realm, realm)); // https://github.com/tc39/test262/blob/master/INTERPRETING.md#host-defined-functions u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, "print", print, 1, attr); define_direct_property("$262", m_$262, attr); - - return {}; } void GlobalObject::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h index 11112a7c9a..d416548075 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h +++ b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h @@ -15,7 +15,7 @@ class GlobalObject final : public JS::GlobalObject { JS_OBJECT(GlobalObject, JS::GlobalObject); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~GlobalObject() override = default; $262Object* $262() const { return m_$262; } diff --git a/Userland/Libraries/LibJS/Heap/Cell.cpp b/Userland/Libraries/LibJS/Heap/Cell.cpp index aebe7d5bbc..c5deb497a0 100644 --- a/Userland/Libraries/LibJS/Heap/Cell.cpp +++ b/Userland/Libraries/LibJS/Heap/Cell.cpp @@ -11,9 +11,8 @@ namespace JS { -ThrowCompletionOr JS::Cell::initialize(JS::Realm&) +void JS::Cell::initialize(JS::Realm&) { - return {}; } void JS::Cell::Visitor::visit(JS::Value value) diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h index b7e808bbd6..46f0bffa5a 100644 --- a/Userland/Libraries/LibJS/Heap/Cell.h +++ b/Userland/Libraries/LibJS/Heap/Cell.h @@ -31,7 +31,7 @@ class Cell { AK_MAKE_NONMOVABLE(Cell); public: - virtual ThrowCompletionOr initialize(Realm&); + virtual void initialize(Realm&); virtual ~Cell() = default; bool is_marked() const { return m_mark; } diff --git a/Userland/Libraries/LibJS/Heap/Heap.h b/Userland/Libraries/LibJS/Heap/Heap.h index 946a2a5cc2..400d2258a8 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.h +++ b/Userland/Libraries/LibJS/Heap/Heap.h @@ -48,7 +48,7 @@ public: auto* memory = allocate_cell(sizeof(T)); new (memory) T(forward(args)...); auto* cell = static_cast(memory); - MUST_OR_THROW_OOM(memory->initialize(realm)); + memory->initialize(realm); return *cell; } diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp index 1b8cbf50fc..fa13c71cce 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp @@ -19,17 +19,15 @@ AggregateErrorConstructor::AggregateErrorConstructor(Realm& realm) { } -ThrowCompletionOr AggregateErrorConstructor::initialize(Realm& realm) +void AggregateErrorConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 20.5.7.2.1 AggregateError.prototype, https://tc39.es/ecma262/#sec-aggregate-error.prototype define_direct_property(vm.names.prototype, realm.intrinsics().aggregate_error_prototype(), 0); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); - - return {}; } // 20.5.7.1.1 AggregateError ( errors, message [ , options ] ), https://tc39.es/ecma262/#sec-aggregate-error diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h index 56c14127e3..ee146040ab 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.h @@ -14,7 +14,7 @@ class AggregateErrorConstructor final : public NativeFunction { JS_OBJECT(AggregateErrorConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AggregateErrorConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp index 3f03b0eb23..7fc91f6f41 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.cpp @@ -15,15 +15,13 @@ AggregateErrorPrototype::AggregateErrorPrototype(Realm& realm) { } -ThrowCompletionOr AggregateErrorPrototype::initialize(Realm& realm) +void AggregateErrorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; - define_direct_property(vm.names.name, MUST_OR_THROW_OOM(PrimitiveString::create(vm, "AggregateError"sv)), attr); + define_direct_property(vm.names.name, MUST(PrimitiveString::create(vm, "AggregateError"sv)), attr); define_direct_property(vm.names.message, PrimitiveString::create(vm, String {}), attr); - - return {}; } } diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h index 3bab30af24..420a0864f0 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorPrototype.h @@ -14,7 +14,7 @@ class AggregateErrorPrototype final : public Object { JS_OBJECT(AggregateErrorPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AggregateErrorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp index 97d23095b0..18b2aa5cf5 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.cpp @@ -16,13 +16,11 @@ ArgumentsObject::ArgumentsObject(Realm& realm, Environment& environment) { } -ThrowCompletionOr ArgumentsObject::initialize(Realm& realm) +void ArgumentsObject::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_has_parameter_map(); m_parameter_map = Object::create(realm, nullptr); - - return {}; } void ArgumentsObject::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h index adcb4ff2de..166d2430ff 100644 --- a/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h +++ b/Userland/Libraries/LibJS/Runtime/ArgumentsObject.h @@ -16,7 +16,7 @@ class ArgumentsObject final : public Object { JS_OBJECT(ArgumentsObject, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ArgumentsObject() override = default; Environment& environment() { return m_environment; } diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp index cfe3fce65b..ca09ebdbec 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp @@ -19,10 +19,10 @@ ArrayBufferConstructor::ArrayBufferConstructor(Realm& realm) { } -ThrowCompletionOr ArrayBufferConstructor::initialize(Realm& realm) +void ArrayBufferConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 25.1.4.2 ArrayBuffer.prototype, https://tc39.es/ecma262/#sec-arraybuffer.prototype define_direct_property(vm.names.prototype, realm.intrinsics().array_buffer_prototype(), 0); @@ -34,8 +34,6 @@ ThrowCompletionOr ArrayBufferConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 25.1.3.1 ArrayBuffer ( length ), https://tc39.es/ecma262/#sec-arraybuffer-length diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h index 07b25d94c5..60a4fb82a7 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h @@ -14,7 +14,7 @@ class ArrayBufferConstructor final : public NativeFunction { JS_OBJECT(ArrayBufferConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ArrayBufferConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp index fbfcddeac0..8041587d8e 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp @@ -19,10 +19,10 @@ ArrayBufferPrototype::ArrayBufferPrototype(Realm& realm) { } -ThrowCompletionOr ArrayBufferPrototype::initialize(Realm& realm) +void ArrayBufferPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.slice, slice, 2, attr); define_native_function(realm, vm.names.transfer, transfer, 0, attr); @@ -32,8 +32,6 @@ ThrowCompletionOr ArrayBufferPrototype::initialize(Realm& realm) // 25.1.5.4 ArrayBuffer.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-arraybuffer.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.ArrayBuffer.as_string()), Attribute::Configurable); - - return {}; } // 25.1.5.3 ArrayBuffer.prototype.slice ( start, end ), https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h index 3486f70755..d3eb4bf348 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.h @@ -15,7 +15,7 @@ class ArrayBufferPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ArrayBufferPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp index 075b4b3511..e5086237fc 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp @@ -27,10 +27,10 @@ ArrayConstructor::ArrayConstructor(Realm& realm) { } -ThrowCompletionOr ArrayConstructor::initialize(Realm& realm) +void ArrayConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 23.1.2.4 Array.prototype, https://tc39.es/ecma262/#sec-array.prototype define_direct_property(vm.names.prototype, realm.intrinsics().array_prototype(), 0); @@ -45,8 +45,6 @@ ThrowCompletionOr ArrayConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 23.1.1.1 Array ( ...values ), https://tc39.es/ecma262/#sec-array diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h index 73f8f4bafa..6745773551 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.h @@ -14,7 +14,7 @@ class ArrayConstructor final : public NativeFunction { JS_OBJECT(ArrayConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ArrayConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp index b1f0b85a9c..26bbc3d694 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp @@ -19,17 +19,15 @@ ArrayIteratorPrototype::ArrayIteratorPrototype(Realm& realm) { } -ThrowCompletionOr ArrayIteratorPrototype::initialize(Realm& realm) +void ArrayIteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_function(realm, vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); // 23.1.5.2.2 %ArrayIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%arrayiteratorprototype%-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Array Iterator"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Array Iterator"sv)), Attribute::Configurable); } // 23.1.5.2.1 %ArrayIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h index 003774a82e..25c53bdcec 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.h @@ -15,7 +15,7 @@ class ArrayIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ArrayIteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index b86936bb25..d36542680e 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -33,10 +33,10 @@ ArrayPrototype::ArrayPrototype(Realm& realm) { } -ThrowCompletionOr ArrayPrototype::initialize(Realm& realm) +void ArrayPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Array::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.at, at, 1, attr); @@ -104,8 +104,6 @@ ThrowCompletionOr ArrayPrototype::initialize(Realm& realm) MUST(unscopable_list->create_data_property_or_throw(vm.names.values, Value(true))); define_direct_property(vm.well_known_symbol_unscopables(), unscopable_list, Attribute::Configurable); - - return {}; } // 10.4.2.3 ArraySpeciesCreate ( originalArray, length ), https://tc39.es/ecma262/#sec-arrayspeciescreate diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h index a9de2dadee..1b29a08b5a 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h @@ -15,7 +15,7 @@ class ArrayPrototype final : public Array { JS_OBJECT(ArrayPrototype, Array); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ArrayPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp index 008782b75f..a28fe0f908 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp @@ -22,12 +22,6 @@ AsyncFromSyncIterator::AsyncFromSyncIterator(Realm& realm, IteratorRecord sync_i { } -ThrowCompletionOr AsyncFromSyncIterator::initialize(Realm& realm) -{ - MUST_OR_THROW_OOM(Base::initialize(realm)); - return {}; -} - void AsyncFromSyncIterator::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h index adbbbda039..9b827a976a 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.h @@ -19,7 +19,6 @@ class AsyncFromSyncIterator final : public Object { public: static NonnullGCPtr create(Realm&, IteratorRecord sync_iterator_record); - virtual ThrowCompletionOr initialize(Realm&) override; virtual ~AsyncFromSyncIterator() override = default; void visit_edges(Visitor& visitor) override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp index a261a9a3b6..569f15c474 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.cpp @@ -19,17 +19,15 @@ AsyncFromSyncIteratorPrototype::AsyncFromSyncIteratorPrototype(Realm& realm) { } -ThrowCompletionOr AsyncFromSyncIteratorPrototype::initialize(Realm& realm) +void AsyncFromSyncIteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.next, next, 1, attr); define_native_function(realm, vm.names.return_, return_, 1, attr); define_native_function(realm, vm.names.throw_, throw_, 1, attr); - - return {}; } // 27.1.4.4 AsyncFromSyncIteratorContinuation ( result, promiseCapability ), https://tc39.es/ecma262/#sec-asyncfromsynciteratorcontinuation diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h index 61184dd769..aacc5bd8c3 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIteratorPrototype.h @@ -19,7 +19,7 @@ class AsyncFromSyncIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AsyncFromSyncIteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp index c9e21d8353..656d4837aa 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.cpp @@ -17,17 +17,15 @@ AsyncFunctionConstructor::AsyncFunctionConstructor(Realm& realm) { } -ThrowCompletionOr AsyncFunctionConstructor::initialize(Realm& realm) +void AsyncFunctionConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 27.7.2.2 AsyncFunction.prototype, https://tc39.es/ecma262/#sec-async-function-constructor-prototype define_direct_property(vm.names.prototype, realm.intrinsics().async_function_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 27.7.1.1 AsyncFunction ( p1, p2, … , pn, body ), https://tc39.es/ecma262/#sec-async-function-constructor-arguments diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h index 585daf942d..cf11753202 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionConstructor.h @@ -14,7 +14,7 @@ class AsyncFunctionConstructor final : public NativeFunction { JS_OBJECT(AsyncFunctionConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AsyncFunctionConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp index e4e823e575..6ca69d3327 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.cpp @@ -14,15 +14,13 @@ AsyncFunctionPrototype::AsyncFunctionPrototype(Realm& realm) { } -ThrowCompletionOr AsyncFunctionPrototype::initialize(Realm& realm) +void AsyncFunctionPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // 27.7.3.2 AsyncFunction.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-async-function-prototype-properties-toStringTag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.AsyncFunction.as_string()), Attribute::Configurable); - - return {}; } } diff --git a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h index 10c534f831..44a532f8bc 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncFunctionPrototype.h @@ -14,7 +14,7 @@ class AsyncFunctionPrototype final : public Object { JS_OBJECT(AsyncFunctionPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AsyncFunctionPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp index 67610de6fc..6e3ba3849b 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.cpp @@ -17,18 +17,16 @@ AsyncGeneratorFunctionConstructor::AsyncGeneratorFunctionConstructor(Realm& real { } -ThrowCompletionOr AsyncGeneratorFunctionConstructor::initialize(Realm& realm) +void AsyncGeneratorFunctionConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 27.4.2.1 AsyncGeneratorFunction.length, https://tc39.es/ecma262/#sec-asyncgeneratorfunction-length define_direct_property(vm.names.length, Value(1), Attribute::Configurable); // 27.4.2.2 AsyncGeneratorFunction.prototype, https://tc39.es/ecma262/#sec-asyncgeneratorfunction-prototype define_direct_property(vm.names.prototype, realm.intrinsics().async_generator_function_prototype(), 0); - - return {}; } // 27.4.1.1 AsyncGeneratorFunction ( p1, p2, … , pn, body ), https://tc39.es/ecma262/#sec-asyncgeneratorfunction diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h index 8350ef8a63..0b1a4e26d2 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionConstructor.h @@ -14,7 +14,7 @@ class AsyncGeneratorFunctionConstructor final : public NativeFunction { JS_OBJECT(AsyncGeneratorFunctionConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AsyncGeneratorFunctionConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp index b52c63123c..83bb2b1981 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.cpp @@ -16,10 +16,10 @@ AsyncGeneratorFunctionPrototype::AsyncGeneratorFunctionPrototype(Realm& realm) { } -ThrowCompletionOr AsyncGeneratorFunctionPrototype::initialize(Realm& realm) +void AsyncGeneratorFunctionPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // The constructor cannot be set at this point since it has not been initialized. @@ -28,8 +28,6 @@ ThrowCompletionOr AsyncGeneratorFunctionPrototype::initialize(Realm& realm // 27.4.3.3 AsyncGeneratorFunction.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-asyncgeneratorfunction-prototype-tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.AsyncGeneratorFunction.as_string()), Attribute::Configurable); - - return {}; } } diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h index 2a2bb7f217..602a947d94 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorFunctionPrototype.h @@ -14,7 +14,7 @@ class AsyncGeneratorFunctionPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AsyncGeneratorFunctionPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp index eb1ffa2c38..badce06ab5 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.cpp @@ -18,19 +18,17 @@ AsyncGeneratorPrototype::AsyncGeneratorPrototype(Realm& realm) { } -ThrowCompletionOr AsyncGeneratorPrototype::initialize(Realm& realm) +void AsyncGeneratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.next, next, 1, attr); define_native_function(realm, vm.names.return_, return_, 1, attr); define_native_function(realm, vm.names.throw_, throw_, 1, attr); // 27.6.1.5 AsyncGenerator.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-asyncgenerator-prototype-tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "AsyncGenerator"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "AsyncGenerator"sv)), Attribute::Configurable); } // 27.6.3.3 AsyncGeneratorValidate ( generator, generatorBrand ), https://tc39.es/ecma262/#sec-asyncgeneratorvalidate diff --git a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h index bef457bb07..03ab34fe35 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncGeneratorPrototype.h @@ -16,7 +16,7 @@ class AsyncGeneratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AsyncGeneratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp index 59cb821149..f5600a9cf1 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.cpp @@ -13,14 +13,12 @@ AsyncIteratorPrototype::AsyncIteratorPrototype(Realm& realm) { } -ThrowCompletionOr AsyncIteratorPrototype::initialize(Realm& realm) +void AsyncIteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.well_known_symbol_async_iterator(), symbol_async_iterator, 0, attr); - - return {}; } // 27.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( ), https://tc39.es/ecma262/#sec-asynciteratorprototype-asynciterator diff --git a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h index 0313254778..07f2f962aa 100644 --- a/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/AsyncIteratorPrototype.h @@ -14,7 +14,7 @@ class AsyncIteratorPrototype final : public Object { JS_OBJECT(AsyncIteratorPrototype, Object) public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AsyncIteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp index 78317d3ac8..b3bd9cf5b8 100644 --- a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp @@ -129,9 +129,9 @@ AtomicsObject::AtomicsObject(Realm& realm) { } -ThrowCompletionOr AtomicsObject::initialize(Realm& realm) +void AtomicsObject::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); u8 attr = Attribute::Writable | Attribute::Configurable; @@ -147,9 +147,7 @@ ThrowCompletionOr AtomicsObject::initialize(Realm& realm) define_native_function(realm, vm.names.xor_, xor_, 3, attr); // 25.4.15 Atomics [ @@toStringTag ], https://tc39.es/ecma262/#sec-atomics-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Atomics"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Atomics"sv)), Attribute::Configurable); } // 25.4.3 Atomics.add ( typedArray, index, value ), https://tc39.es/ecma262/#sec-atomics.add diff --git a/Userland/Libraries/LibJS/Runtime/AtomicsObject.h b/Userland/Libraries/LibJS/Runtime/AtomicsObject.h index 428e02779d..1e245d8590 100644 --- a/Userland/Libraries/LibJS/Runtime/AtomicsObject.h +++ b/Userland/Libraries/LibJS/Runtime/AtomicsObject.h @@ -14,7 +14,7 @@ class AtomicsObject : public Object { JS_OBJECT(AtomicsObject, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~AtomicsObject() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp index 6c25896d40..dd12eeff57 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp @@ -21,10 +21,10 @@ BigIntConstructor::BigIntConstructor(Realm& realm) { } -ThrowCompletionOr BigIntConstructor::initialize(Realm& realm) +void BigIntConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 21.2.2.3 BigInt.prototype, https://tc39.es/ecma262/#sec-bigint.prototype define_direct_property(vm.names.prototype, realm.intrinsics().bigint_prototype(), 0); @@ -34,8 +34,6 @@ ThrowCompletionOr BigIntConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.asUintN, as_uint_n, 2, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 21.2.1.1 BigInt ( value ), https://tc39.es/ecma262/#sec-bigint-constructor-number-value diff --git a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h index a974a63870..59335e3318 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.h @@ -14,7 +14,7 @@ class BigIntConstructor final : public NativeFunction { JS_OBJECT(BigIntConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~BigIntConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp index f629b3eb84..16df2d72e4 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp @@ -22,10 +22,10 @@ BigIntPrototype::BigIntPrototype(Realm& realm) { } -ThrowCompletionOr BigIntPrototype::initialize(Realm& realm) +void BigIntPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.toString, to_string, 0, attr); define_native_function(realm, vm.names.toLocaleString, to_locale_string, 0, attr); @@ -33,8 +33,6 @@ ThrowCompletionOr BigIntPrototype::initialize(Realm& realm) // 21.2.3.5 BigInt.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-bigint.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.BigInt.as_string()), Attribute::Configurable); - - return {}; } // thisBigIntValue ( value ), https://tc39.es/ecma262/#thisbigintvalue diff --git a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h index 6b3b80f31c..ca95f9684b 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.h @@ -14,7 +14,7 @@ class BigIntPrototype final : public Object { JS_OBJECT(BigIntPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~BigIntPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp index 8850882207..aef4fd883c 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp @@ -17,17 +17,15 @@ BooleanConstructor::BooleanConstructor(Realm& realm) { } -ThrowCompletionOr BooleanConstructor::initialize(Realm& realm) +void BooleanConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 20.3.2.1 Boolean.prototype, https://tc39.es/ecma262/#sec-boolean.prototype define_direct_property(vm.names.prototype, realm.intrinsics().boolean_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 20.3.1.1 Boolean ( value ), https://tc39.es/ecma262/#sec-boolean-constructor-boolean-value diff --git a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h index 4666e54d69..3520b64a1d 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.h @@ -14,7 +14,7 @@ class BooleanConstructor final : public NativeFunction { JS_OBJECT(BooleanConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~BooleanConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp index a0a8b3a793..0d3e1c715e 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp @@ -18,15 +18,13 @@ BooleanPrototype::BooleanPrototype(Realm& realm) { } -ThrowCompletionOr BooleanPrototype::initialize(Realm& realm) +void BooleanPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(BooleanObject::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.toString, to_string, 0, attr); define_native_function(realm, vm.names.valueOf, value_of, 0, attr); - - return {}; } // thisBooleanValue ( value ), https://tc39.es/ecma262/#thisbooleanvalue diff --git a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h index b4d6c36b9a..83af2e841d 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.h @@ -14,7 +14,7 @@ class BooleanPrototype final : public BooleanObject { JS_OBJECT(BooleanPrototype, BooleanObject); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~BooleanPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp index 1a1bead0f0..681ded39a1 100644 --- a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp @@ -18,10 +18,10 @@ ConsoleObject::ConsoleObject(Realm& realm) { } -ThrowCompletionOr ConsoleObject::initialize(Realm& realm) +void ConsoleObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Enumerable | Attribute::Configurable; define_native_function(realm, vm.names.assert, assert_, 0, attr); define_native_function(realm, vm.names.clear, clear, 0, attr); @@ -40,8 +40,6 @@ ThrowCompletionOr ConsoleObject::initialize(Realm& realm) define_native_function(realm, vm.names.time, time, 0, attr); define_native_function(realm, vm.names.timeLog, time_log, 0, attr); define_native_function(realm, vm.names.timeEnd, time_end, 0, attr); - - return {}; } // 1.1.1. assert(condition, ...data), https://console.spec.whatwg.org/#assert diff --git a/Userland/Libraries/LibJS/Runtime/ConsoleObject.h b/Userland/Libraries/LibJS/Runtime/ConsoleObject.h index 79e0e2928b..29b2cadb36 100644 --- a/Userland/Libraries/LibJS/Runtime/ConsoleObject.h +++ b/Userland/Libraries/LibJS/Runtime/ConsoleObject.h @@ -14,7 +14,7 @@ class ConsoleObject final : public Object { JS_OBJECT(ConsoleObject, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ConsoleObject() override = default; Console& console() { return *m_console; } diff --git a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp index 6233a0e47e..dec14a8543 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp @@ -19,17 +19,15 @@ DataViewConstructor::DataViewConstructor(Realm& realm) { } -ThrowCompletionOr DataViewConstructor::initialize(Realm& realm) +void DataViewConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 25.3.3.1 DataView.prototype, https://tc39.es/ecma262/#sec-dataview.prototype define_direct_property(vm.names.prototype, realm.intrinsics().data_view_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 25.3.2.1 DataView ( buffer [ , byteOffset [ , byteLength ] ] ), https://tc39.es/ecma262/#sec-dataview-buffer-byteoffset-bytelength diff --git a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h index c78c3bf94f..632c4e0e86 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.h @@ -14,7 +14,7 @@ class DataViewConstructor final : public NativeFunction { JS_OBJECT(DataViewConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DataViewConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp index 2565d32c58..4f7af5ec7d 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp @@ -15,10 +15,10 @@ DataViewPrototype::DataViewPrototype(Realm& realm) { } -ThrowCompletionOr DataViewPrototype::initialize(Realm& realm) +void DataViewPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.getBigInt64, get_big_int_64, 1, attr); @@ -48,8 +48,6 @@ ThrowCompletionOr DataViewPrototype::initialize(Realm& realm) // 25.3.4.25 DataView.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-dataview.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.DataView.as_string()), Attribute::Configurable); - - return {}; } // 25.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ), https://tc39.es/ecma262/#sec-getviewvalue diff --git a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h index e0f1899ebb..7138918922 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.h @@ -15,7 +15,7 @@ class DataViewPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DataViewPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index 40744af009..e373c71477 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -185,10 +185,10 @@ DateConstructor::DateConstructor(Realm& realm) { } -ThrowCompletionOr DateConstructor::initialize(Realm& realm) +void DateConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 21.4.3.3 Date.prototype, https://tc39.es/ecma262/#sec-date.prototype define_direct_property(vm.names.prototype, realm.intrinsics().date_prototype(), 0); @@ -199,8 +199,6 @@ ThrowCompletionOr DateConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.UTC, utc, 7, attr); define_direct_property(vm.names.length, Value(7), Attribute::Configurable); - - return {}; } // 21.4.2.1 Date ( ...values ), https://tc39.es/ecma262/#sec-date diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.h b/Userland/Libraries/LibJS/Runtime/DateConstructor.h index fabfeddda7..7e66408ffa 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.h @@ -14,7 +14,7 @@ class DateConstructor final : public NativeFunction { JS_OBJECT(DateConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DateConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp index 08bd5d5fd5..7c182bc6b8 100644 --- a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp @@ -34,10 +34,10 @@ DatePrototype::DatePrototype(Realm& realm) { } -ThrowCompletionOr DatePrototype::initialize(Realm& realm) +void DatePrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.getDate, get_date, 0, attr); define_native_function(realm, vm.names.getDay, get_day, 0, attr); @@ -95,8 +95,6 @@ ThrowCompletionOr DatePrototype::initialize(Realm& realm) // B.2.4.3 Date.prototype.toGMTString ( ), https://tc39.es/ecma262/#sec-date.prototype.togmtstring // The initial value of the "toGMTString" property is %Date.prototype.toUTCString%, defined in 21.4.4.43. define_direct_property(vm.names.toGMTString, get_without_side_effects(vm.names.toUTCString), attr); - - return {}; } // thisTimeValue ( value ), https://tc39.es/ecma262/#thistimevalue diff --git a/Userland/Libraries/LibJS/Runtime/DatePrototype.h b/Userland/Libraries/LibJS/Runtime/DatePrototype.h index 9bbae1316f..c54223ccff 100644 --- a/Userland/Libraries/LibJS/Runtime/DatePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/DatePrototype.h @@ -15,7 +15,7 @@ class DatePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(DatePrototype, Date, Date); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DatePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp index ae7a5d43d2..8e2c4fad0e 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.cpp @@ -15,17 +15,15 @@ DisposableStackConstructor::DisposableStackConstructor(Realm& realm) { } -ThrowCompletionOr DisposableStackConstructor::initialize(Realm& realm) +void DisposableStackConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 26.2.2.1 DisposableStack.prototype, https://tc39.es/ecma262/#sec-finalization-registry.prototype define_direct_property(vm.names.prototype, realm.intrinsics().disposable_stack_prototype(), 0); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 11.3.1.1 DisposableStack ( ), https://tc39.es/proposal-explicit-resource-management/#sec-disposablestack diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h index 138e81e1a2..b512657a36 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackConstructor.h @@ -14,7 +14,7 @@ class DisposableStackConstructor final : public NativeFunction { JS_OBJECT(DisposableStackConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DisposableStackConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp index 4f7e7d317f..a13d84bb6b 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp @@ -17,10 +17,10 @@ DisposableStackPrototype::DisposableStackPrototype(Realm& realm) { } -ThrowCompletionOr DisposableStackPrototype::initialize(Realm& realm) +void DisposableStackPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_accessor(realm, vm.names.disposed, disposed_getter, {}, attr); @@ -35,8 +35,6 @@ ThrowCompletionOr DisposableStackPrototype::initialize(Realm& realm) // 11.3.3.8 DisposableStack.prototype [ @@toStringTag ], https://tc39.es/proposal-explicit-resource-management/#sec-disposablestack.prototype-@@toStringTag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.DisposableStack.as_string()), Attribute::Configurable); - - return {}; } // 11.3.3.1 get DisposableStack.prototype.disposed, https://tc39.es/proposal-explicit-resource-management/#sec-get-disposablestack.prototype.disposed diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h index 4dfc6fc7f0..6b093a12aa 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.h @@ -15,7 +15,7 @@ class DisposableStackPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DisposableStackPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index 0190991b9c..a306b749e1 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -101,10 +101,10 @@ ECMAScriptFunctionObject::ECMAScriptFunctionObject(DeprecatedFlyString name, Dep }); } -ThrowCompletionOr ECMAScriptFunctionObject::initialize(Realm& realm) +void ECMAScriptFunctionObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // Note: The ordering of these properties must be: length, name, prototype which is the order // they are defined in the spec: https://tc39.es/ecma262/#sec-function-instances . // This is observable through something like: https://tc39.es/ecma262/#sec-ordinaryownpropertykeys @@ -118,7 +118,7 @@ ThrowCompletionOr ECMAScriptFunctionObject::initialize(Realm& realm) Object* prototype = nullptr; switch (m_kind) { case FunctionKind::Normal: - prototype = MUST_OR_THROW_OOM(vm.heap().allocate(realm, realm.intrinsics().new_ordinary_function_prototype_object_shape())); + prototype = MUST(vm.heap().allocate(realm, realm.intrinsics().new_ordinary_function_prototype_object_shape())); MUST(prototype->define_property_or_throw(vm.names.constructor, { .value = this, .writable = true, .enumerable = false, .configurable = true })); break; case FunctionKind::Generator: @@ -136,8 +136,6 @@ ThrowCompletionOr ECMAScriptFunctionObject::initialize(Realm& realm) if (m_kind != FunctionKind::Async) define_direct_property(vm.names.prototype, prototype, Attribute::Writable); } - - return {}; } // 10.2.1 [[Call]] ( thisArgument, argumentsList ), https://tc39.es/ecma262/#sec-ecmascript-function-objects-call-thisargument-argumentslist diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h index ae707b34b1..e15094b541 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h @@ -40,7 +40,7 @@ public: static NonnullGCPtr create(Realm&, DeprecatedFlyString name, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant class_field_initializer_name = {}); static NonnullGCPtr create(Realm&, DeprecatedFlyString name, Object& prototype, DeprecatedString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, bool might_need_arguments_object = true, bool contains_direct_call_to_eval = true, bool is_arrow_function = false, Variant class_field_initializer_name = {}); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ECMAScriptFunctionObject() override = default; virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) override; diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp index 8f8692f5e4..43c0bf50e3 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp @@ -16,17 +16,15 @@ ErrorConstructor::ErrorConstructor(Realm& realm) { } -ThrowCompletionOr ErrorConstructor::initialize(Realm& realm) +void ErrorConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 20.5.2.1 Error.prototype, https://tc39.es/ecma262/#sec-error.prototype define_direct_property(vm.names.prototype, realm.intrinsics().error_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 20.5.1.1 Error ( message [ , options ] ), https://tc39.es/ecma262/#sec-error-message @@ -69,17 +67,15 @@ ThrowCompletionOr> ErrorConstructor::construct(FunctionObje { \ } \ \ - ThrowCompletionOr ConstructorName::initialize(Realm& realm) \ + void ConstructorName::initialize(Realm& realm) \ { \ auto& vm = this->vm(); \ - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); \ + Base::initialize(realm); \ \ /* 20.5.6.2.1 NativeError.prototype, https://tc39.es/ecma262/#sec-nativeerror.prototype */ \ define_direct_property(vm.names.prototype, realm.intrinsics().snake_name##_prototype(), 0); \ \ define_direct_property(vm.names.length, Value(1), Attribute::Configurable); \ - \ - return {}; \ } \ \ ConstructorName::~ConstructorName() = default; \ diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h index d991cadf8a..2bc6996308 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.h @@ -15,7 +15,7 @@ class ErrorConstructor final : public NativeFunction { JS_OBJECT(ErrorConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ErrorConstructor() override = default; virtual ThrowCompletionOr call() override; @@ -32,7 +32,7 @@ private: JS_OBJECT(ConstructorName, NativeFunction); \ \ public: \ - virtual ThrowCompletionOr initialize(Realm&) override; \ + virtual void initialize(Realm&) override; \ virtual ~ConstructorName() override; \ virtual ThrowCompletionOr call() override; \ virtual ThrowCompletionOr> construct(FunctionObject& new_target) override; \ diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp index 235f625119..d21380004d 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp @@ -19,20 +19,18 @@ ErrorPrototype::ErrorPrototype(Realm& realm) { } -ThrowCompletionOr ErrorPrototype::initialize(Realm& realm) +void ErrorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; - define_direct_property(vm.names.name, MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Error"sv)), attr); + define_direct_property(vm.names.name, MUST(PrimitiveString::create(vm, "Error"sv)), attr); define_direct_property(vm.names.message, PrimitiveString::create(vm, String {}), attr); define_native_function(realm, vm.names.toString, to_string, 0, attr); // Non standard property "stack" // Every other engine seems to have this in some way or another, and the spec // proposal for this is only Stage 1 define_native_accessor(realm, vm.names.stack, stack_getter, stack_setter, attr); - - return {}; } // 20.5.3.4 Error.prototype.toString ( ), https://tc39.es/ecma262/#sec-error.prototype.tostring @@ -124,21 +122,19 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::stack_setter) return TRY(this_object.create_data_property_or_throw(vm.names.stack, vm.argument(0))); } -#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ - PrototypeName::PrototypeName(Realm& realm) \ - : PrototypeObject(realm.intrinsics().error_prototype()) \ - { \ - } \ - \ - ThrowCompletionOr PrototypeName::initialize(Realm& realm) \ - { \ - auto& vm = this->vm(); \ - MUST_OR_THROW_OOM(Base::initialize(realm)); \ - u8 attr = Attribute::Writable | Attribute::Configurable; \ - define_direct_property(vm.names.name, MUST_OR_THROW_OOM(PrimitiveString::create(vm, #ClassName##sv)), attr); \ - define_direct_property(vm.names.message, PrimitiveString::create(vm, String {}), attr); \ - \ - return {}; \ +#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ + PrototypeName::PrototypeName(Realm& realm) \ + : PrototypeObject(realm.intrinsics().error_prototype()) \ + { \ + } \ + \ + void PrototypeName::initialize(Realm& realm) \ + { \ + auto& vm = this->vm(); \ + Base::initialize(realm); \ + u8 attr = Attribute::Writable | Attribute::Configurable; \ + define_direct_property(vm.names.name, MUST(PrimitiveString::create(vm, #ClassName##sv)), attr); \ + define_direct_property(vm.names.message, PrimitiveString::create(vm, String {}), attr); \ } JS_ENUMERATE_NATIVE_ERRORS diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h index 19f1b42464..7be8d62fa4 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.h @@ -16,7 +16,7 @@ class ErrorPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(ErrorPrototype, Error, Error); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ErrorPrototype() override = default; private: @@ -32,7 +32,7 @@ private: JS_PROTOTYPE_OBJECT(PrototypeName, ClassName, ClassName); \ \ public: \ - virtual ThrowCompletionOr initialize(Realm&) override; \ + virtual void initialize(Realm&) override; \ virtual ~PrototypeName() override = default; \ \ private: \ diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp index 4736650129..0350ae625d 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp @@ -18,17 +18,15 @@ FinalizationRegistryConstructor::FinalizationRegistryConstructor(Realm& realm) { } -ThrowCompletionOr FinalizationRegistryConstructor::initialize(Realm& realm) +void FinalizationRegistryConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 26.2.2.1 FinalizationRegistry.prototype, https://tc39.es/ecma262/#sec-finalization-registry.prototype define_direct_property(vm.names.prototype, realm.intrinsics().finalization_registry_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 26.2.1.1 FinalizationRegistry ( cleanupCallback ), https://tc39.es/ecma262/#sec-finalization-registry-cleanup-callback diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h index 806ac9dabc..a93a1c2315 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.h @@ -14,7 +14,7 @@ class FinalizationRegistryConstructor final : public NativeFunction { JS_OBJECT(FinalizationRegistryConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~FinalizationRegistryConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp index fbac039c35..dc6f727d17 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp @@ -15,10 +15,10 @@ FinalizationRegistryPrototype::FinalizationRegistryPrototype(Realm& realm) { } -ThrowCompletionOr FinalizationRegistryPrototype::initialize(Realm& realm) +void FinalizationRegistryPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.cleanupSome, cleanup_some, 0, attr); @@ -27,8 +27,6 @@ ThrowCompletionOr FinalizationRegistryPrototype::initialize(Realm& realm) // 26.2.3.4 FinalizationRegistry.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-finalization-registry.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.FinalizationRegistry.as_string()), Attribute::Configurable); - - return {}; } // @STAGE 2@ FinalizationRegistry.prototype.cleanupSome ( [ callback ] ), https://github.com/tc39/proposal-cleanup-some/blob/master/spec/finalization-registry.html diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h index fac93ba67f..a63e759ca7 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.h @@ -15,7 +15,7 @@ class FinalizationRegistryPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~FinalizationRegistryPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp index 24c74a883c..05fef5bf3a 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp @@ -23,17 +23,15 @@ FunctionConstructor::FunctionConstructor(Realm& realm) { } -ThrowCompletionOr FunctionConstructor::initialize(Realm& realm) +void FunctionConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 20.2.2.2 Function.prototype, https://tc39.es/ecma262/#sec-function.prototype define_direct_property(vm.names.prototype, realm.intrinsics().function_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 20.2.1.1.1 CreateDynamicFunction ( constructor, newTarget, kind, args ), https://tc39.es/ecma262/#sec-createdynamicfunction diff --git a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h index 872ad2feb2..1cf6ad0613 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.h @@ -17,7 +17,7 @@ class FunctionConstructor final : public NativeFunction { public: static ThrowCompletionOr create_dynamic_function(VM&, FunctionObject& constructor, FunctionObject* new_target, FunctionKind kind, MarkedVector const& args); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~FunctionConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.h b/Userland/Libraries/LibJS/Runtime/FunctionObject.h index f11187fa28..5434da637e 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionObject.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.h @@ -20,7 +20,6 @@ class FunctionObject : public Object { public: virtual ~FunctionObject() = default; - virtual ThrowCompletionOr initialize(Realm&) override { return {}; } // Table 7: Additional Essential Internal Methods of Function Objects, https://tc39.es/ecma262/#table-additional-essential-internal-methods-of-function-objects diff --git a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp index cafd62b2d5..5e9ef1378f 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp @@ -25,10 +25,10 @@ FunctionPrototype::FunctionPrototype(Realm& realm) { } -ThrowCompletionOr FunctionPrototype::initialize(Realm& realm) +void FunctionPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.apply, apply, 2, attr); define_native_function(realm, vm.names.bind, bind, 1, attr); @@ -37,8 +37,6 @@ ThrowCompletionOr FunctionPrototype::initialize(Realm& realm) define_native_function(realm, vm.well_known_symbol_has_instance(), symbol_has_instance, 1, 0); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); define_direct_property(vm.names.name, PrimitiveString::create(vm, String {}), Attribute::Configurable); - - return {}; } ThrowCompletionOr FunctionPrototype::internal_call(Value, MarkedVector) diff --git a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h index d400a42490..77919d5abc 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.h @@ -14,7 +14,7 @@ class FunctionPrototype final : public FunctionObject { JS_OBJECT(FunctionPrototype, FunctionObject); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~FunctionPrototype() override = default; virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) override; diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp index f81cc67a06..289b90e527 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.cpp @@ -16,17 +16,15 @@ GeneratorFunctionConstructor::GeneratorFunctionConstructor(Realm& realm) { } -ThrowCompletionOr GeneratorFunctionConstructor::initialize(Realm& realm) +void GeneratorFunctionConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 27.3.2.1 GeneratorFunction.length, https://tc39.es/ecma262/#sec-generatorfunction.length define_direct_property(vm.names.length, Value(1), Attribute::Configurable); // 27.3.2.2 GeneratorFunction.prototype, https://tc39.es/ecma262/#sec-generatorfunction.length define_direct_property(vm.names.prototype, realm.intrinsics().generator_function_prototype(), 0); - - return {}; } // 27.3.1.1 GeneratorFunction ( p1, p2, … , pn, body ), https://tc39.es/ecma262/#sec-generatorfunction diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h index a816be43e4..f73ef9e0d8 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionConstructor.h @@ -15,7 +15,7 @@ class GeneratorFunctionConstructor final : public NativeFunction { JS_OBJECT(GeneratorFunctionConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~GeneratorFunctionConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp index 175171d668..93da3bfe2d 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.cpp @@ -15,17 +15,15 @@ GeneratorFunctionPrototype::GeneratorFunctionPrototype(Realm& realm) { } -ThrowCompletionOr GeneratorFunctionPrototype::initialize(Realm& realm) +void GeneratorFunctionPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // 27.3.3.2 GeneratorFunction.prototype.prototype, https://tc39.es/ecma262/#sec-generatorfunction.prototype.prototype define_direct_property(vm.names.prototype, realm.intrinsics().generator_prototype(), Attribute::Configurable); // 27.3.3.3 GeneratorFunction.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-generatorfunction.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "GeneratorFunction"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "GeneratorFunction"sv)), Attribute::Configurable); } } diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h index 18c7509386..84c3483458 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/GeneratorFunctionPrototype.h @@ -16,7 +16,7 @@ class GeneratorFunctionPrototype final : public Object { JS_OBJECT(GeneratorFunctionPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~GeneratorFunctionPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp index 5006e2adce..a56c4b3b01 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.cpp @@ -14,19 +14,17 @@ GeneratorPrototype::GeneratorPrototype(Realm& realm) { } -ThrowCompletionOr GeneratorPrototype::initialize(Realm& realm) +void GeneratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.next, next, 1, attr); define_native_function(realm, vm.names.return_, return_, 1, attr); define_native_function(realm, vm.names.throw_, throw_, 1, attr); // 27.5.1.5 Generator.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-generator.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Generator"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Generator"sv)), Attribute::Configurable); } // 27.5.1.2 Generator.prototype.next ( value ), https://tc39.es/ecma262/#sec-generator.prototype.next diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h index f791a5d635..079e76c5ca 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/GeneratorPrototype.h @@ -16,7 +16,7 @@ class GeneratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~GeneratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index d5c2c5f154..68ebbbcfe5 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -194,17 +194,15 @@ Object& set_default_global_bindings(Realm& realm) return global; } -ThrowCompletionOr GlobalObject::initialize(Realm& realm) +void GlobalObject::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // Non-standard u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.gc, gc, 0, attr); - - return {}; } GlobalObject::~GlobalObject() = default; diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.h b/Userland/Libraries/LibJS/Runtime/GlobalObject.h index 9d72716b01..c40a1f8296 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.h +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.h @@ -19,7 +19,7 @@ class GlobalObject : public Object { friend class Intrinsics; public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~GlobalObject() override; protected: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp index e530a2cfa2..ce573ff057 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp @@ -22,13 +22,11 @@ CollatorCompareFunction::CollatorCompareFunction(Realm& realm, Collator& collato { } -ThrowCompletionOr CollatorCompareFunction::initialize(Realm&) +void CollatorCompareFunction::initialize(Realm&) { auto& vm = this->vm(); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); define_direct_property(vm.names.name, PrimitiveString::create(vm, String {}), Attribute::Configurable); - - return {}; } // 10.3.3.2 CompareStrings ( collator, x, y ), https://tc39.es/ecma402/#sec-collator-comparestrings diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h index 5d39576983..d01d9ae1c3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h @@ -16,7 +16,7 @@ class CollatorCompareFunction : public NativeFunction { public: static NonnullGCPtr create(Realm&, Collator&); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~CollatorCompareFunction() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp index 269546c993..6b336d8e64 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp @@ -135,9 +135,9 @@ CollatorConstructor::CollatorConstructor(Realm& realm) { } -ThrowCompletionOr CollatorConstructor::initialize(Realm& realm) +void CollatorConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -147,8 +147,6 @@ ThrowCompletionOr CollatorConstructor::initialize(Realm& realm) u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); - - return {}; } // 10.1.1 Intl.Collator ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-intl.collator diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h index 257656969d..19ade8f457 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.h @@ -14,7 +14,7 @@ class CollatorConstructor final : public NativeFunction { JS_OBJECT(CollatorConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~CollatorConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp index a1e74356a8..84408151b2 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp @@ -17,20 +17,18 @@ CollatorPrototype::CollatorPrototype(Realm& realm) { } -ThrowCompletionOr CollatorPrototype::initialize(Realm& realm) +void CollatorPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Object::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 10.3.2 Intl.Collator.prototype [ @@toStringTag ], https://tc39.es/ecma402/#sec-intl.collator.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.Collator"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.Collator"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_accessor(realm, vm.names.compare, compare_getter, {}, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 10.3.3 get Intl.Collator.prototype.compare, https://tc39.es/ecma402/#sec-intl.collator.prototype.compare diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h index a0c28c5134..f65e6d2f77 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.h @@ -15,7 +15,7 @@ class CollatorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~CollatorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp index 958d5d5123..e66e6b471e 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp @@ -23,9 +23,9 @@ DateTimeFormatConstructor::DateTimeFormatConstructor(Realm& realm) { } -ThrowCompletionOr DateTimeFormatConstructor::initialize(Realm& realm) +void DateTimeFormatConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -36,8 +36,6 @@ ThrowCompletionOr DateTimeFormatConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 11.1.1 Intl.DateTimeFormat ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-intl.datetimeformat diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h index 42d3e37764..3b5cdb830b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.h @@ -14,7 +14,7 @@ class DateTimeFormatConstructor final : public NativeFunction { JS_OBJECT(DateTimeFormatConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DateTimeFormatConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp index f4b2fe2430..11e93ed387 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.cpp @@ -25,15 +25,13 @@ DateTimeFormatFunction::DateTimeFormatFunction(DateTimeFormat& date_time_format, { } -ThrowCompletionOr DateTimeFormatFunction::initialize(Realm& realm) +void DateTimeFormatFunction::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); define_direct_property(vm.names.name, PrimitiveString::create(vm, String {}), Attribute::Configurable); - - return {}; } ThrowCompletionOr DateTimeFormatFunction::call() diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h index 3d37e65f1e..fa15af8cdb 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatFunction.h @@ -19,7 +19,7 @@ public: static NonnullGCPtr create(Realm&, DateTimeFormat&); virtual ~DateTimeFormatFunction() override = default; - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp index db4ef30637..a3ba82e2e3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.cpp @@ -19,14 +19,14 @@ DateTimeFormatPrototype::DateTimeFormatPrototype(Realm& realm) { } -ThrowCompletionOr DateTimeFormatPrototype::initialize(Realm& realm) +void DateTimeFormatPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 11.3.2 Intl.DateTimeFormat.prototype [ @@toStringTag ], https://tc39.es/ecma402/#sec-intl.datetimeformat.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.DateTimeFormat"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.DateTimeFormat"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.format, format, nullptr, Attribute::Configurable); @@ -35,8 +35,6 @@ ThrowCompletionOr DateTimeFormatPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.formatRange, format_range, 2, attr); define_native_function(realm, vm.names.formatRangeToParts, format_range_to_parts, 2, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 11.3.3 get Intl.DateTimeFormat.prototype.format, https://tc39.es/ecma402/#sec-intl.datetimeformat.prototype.format diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h index 94b297a63f..c72a7bcae3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatPrototype.h @@ -15,7 +15,7 @@ class DateTimeFormatPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DateTimeFormatPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp index 056ee602b4..5468827248 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp @@ -21,9 +21,9 @@ DisplayNamesConstructor::DisplayNamesConstructor(Realm& realm) { } -ThrowCompletionOr DisplayNamesConstructor::initialize(Realm& realm) +void DisplayNamesConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -34,8 +34,6 @@ ThrowCompletionOr DisplayNamesConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); - - return {}; } // 12.1.1 Intl.DisplayNames ( locales, options ), https://tc39.es/ecma402/#sec-Intl.DisplayNames diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h index 656bd07579..68827b3807 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.h @@ -14,7 +14,7 @@ class DisplayNamesConstructor final : public NativeFunction { JS_OBJECT(DisplayNamesConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DisplayNamesConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp index 3f968962c0..7d048c3e06 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp @@ -19,20 +19,18 @@ DisplayNamesPrototype::DisplayNamesPrototype(Realm& realm) { } -ThrowCompletionOr DisplayNamesPrototype::initialize(Realm& realm) +void DisplayNamesPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 12.3.2 Intl.DisplayNames.prototype[ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.DisplayNames"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.DisplayNames"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.of, of, 1, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 12.3.3 Intl.DisplayNames.prototype.of ( code ), https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h index d43009ab3e..57bb97f0c3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.h @@ -15,7 +15,7 @@ class DisplayNamesPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DisplayNamesPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp index 8840bf0410..b006c453be 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp @@ -20,9 +20,9 @@ DurationFormatConstructor::DurationFormatConstructor(Realm& realm) { } -ThrowCompletionOr DurationFormatConstructor::initialize(Realm& realm) +void DurationFormatConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -32,8 +32,6 @@ ThrowCompletionOr DurationFormatConstructor::initialize(Realm& realm) u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); - - return {}; } // 1.2.1 Intl.DurationFormat ( [ locales [ , options ] ] ), https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h index b9c0a69076..81e7f99801 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.h @@ -14,7 +14,7 @@ class DurationFormatConstructor final : public NativeFunction { JS_OBJECT(DurationFormatConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DurationFormatConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp index 07abd72301..d56e963665 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp @@ -18,21 +18,19 @@ DurationFormatPrototype::DurationFormatPrototype(Realm& realm) { } -ThrowCompletionOr DurationFormatPrototype::initialize(Realm& realm) +void DurationFormatPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 1.4.2 Intl.DurationFormat.prototype [ @@toStringTag ], https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.DurationFormat"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.DurationFormat"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.format, format, 1, attr); define_native_function(realm, vm.names.formatToParts, format_to_parts, 1, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 1.4.3 Intl.DurationFormat.prototype.format ( duration ), https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat.prototype.format diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h index 29b0519590..d10942cddf 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.h @@ -15,7 +15,7 @@ class DurationFormatPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DurationFormatPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp index f0b21f4b2f..faabf204e3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp @@ -32,14 +32,14 @@ Intl::Intl(Realm& realm) { } -ThrowCompletionOr Intl::initialize(Realm& realm) +void Intl::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Object::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 8.1.1 Intl[ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl-toStringTag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_intrinsic_accessor(vm.names.Collator, attr, [](auto& realm) -> Value { return realm.intrinsics().intl_collator_constructor(); }); @@ -55,8 +55,6 @@ ThrowCompletionOr Intl::initialize(Realm& realm) define_native_function(realm, vm.names.getCanonicalLocales, get_canonical_locales, 1, attr); define_native_function(realm, vm.names.supportedValuesOf, supported_values_of, 1, attr); - - return {}; } // 8.3.1 Intl.getCanonicalLocales ( locales ), https://tc39.es/ecma402/#sec-intl.getcanonicallocales diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.h b/Userland/Libraries/LibJS/Runtime/Intl/Intl.h index edfe794896..0a9f262f5c 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.h @@ -14,7 +14,7 @@ class Intl final : public Object { JS_OBJECT(Intl, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~Intl() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp index 2a5e3ea048..c6e9a28357 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp @@ -20,9 +20,9 @@ ListFormatConstructor::ListFormatConstructor(Realm& realm) { } -ThrowCompletionOr ListFormatConstructor::initialize(Realm& realm) +void ListFormatConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -33,8 +33,6 @@ ThrowCompletionOr ListFormatConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 13.1.1 Intl.ListFormat ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-Intl.ListFormat diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h index 68638c8989..466b623908 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.h @@ -14,7 +14,7 @@ class ListFormatConstructor final : public NativeFunction { JS_OBJECT(ListFormatConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ListFormatConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp index a55d507bc1..40252f2d78 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp @@ -18,21 +18,19 @@ ListFormatPrototype::ListFormatPrototype(Realm& realm) { } -ThrowCompletionOr ListFormatPrototype::initialize(Realm& realm) +void ListFormatPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 13.3.2 Intl.ListFormat.prototype [ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype-toStringTag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.ListFormat"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.ListFormat"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.format, format, 1, attr); define_native_function(realm, vm.names.formatToParts, format_to_parts, 1, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 13.3.3 Intl.ListFormat.prototype.format ( list ), https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype.format diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h index 2c42e09737..74d5fe3714 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.h @@ -15,7 +15,7 @@ class ListFormatPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ListFormatPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp index ac9a2b343e..d1deda94c7 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp @@ -222,17 +222,15 @@ LocaleConstructor::LocaleConstructor(Realm& realm) { } -ThrowCompletionOr LocaleConstructor::initialize(Realm& realm) +void LocaleConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 14.2.1 Intl.Locale.prototype, https://tc39.es/ecma402/#sec-Intl.Locale.prototype define_direct_property(vm.names.prototype, realm.intrinsics().intl_locale_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 14.1.1 Intl.Locale ( tag [ , options ] ), https://tc39.es/ecma402/#sec-Intl.Locale diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h index 887ef7eb35..645f966805 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.h @@ -14,7 +14,7 @@ class LocaleConstructor final : public NativeFunction { JS_OBJECT(LocaleConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~LocaleConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp index a4194f5db0..2f5adf3076 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp @@ -19,9 +19,9 @@ LocalePrototype::LocalePrototype(Realm& realm) { } -ThrowCompletionOr LocalePrototype::initialize(Realm& realm) +void LocalePrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -31,7 +31,7 @@ ThrowCompletionOr LocalePrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toString, to_string, 0, attr); // 14.3.2 Intl.Locale.prototype[ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl.Locale.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.Locale"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.Locale"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.baseName, base_name, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.calendar, calendar, {}, Attribute::Configurable); @@ -50,8 +50,6 @@ ThrowCompletionOr LocalePrototype::initialize(Realm& realm) define_native_accessor(realm, vm.names.timeZones, time_zones, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.textInfo, text_info, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.weekInfo, week_info, {}, Attribute::Configurable); - - return {}; } // 14.3.3 Intl.Locale.prototype.maximize ( ), https://tc39.es/ecma402/#sec-Intl.Locale.prototype.maximize diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h index 4cf1b29731..03078adbfb 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.h @@ -15,7 +15,7 @@ class LocalePrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(LocalePrototype, Locale, Intl.Locale); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~LocalePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp index 7ecc6fafc5..24461d9433 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp @@ -19,9 +19,9 @@ NumberFormatConstructor::NumberFormatConstructor(Realm& realm) { } -ThrowCompletionOr NumberFormatConstructor::initialize(Realm& realm) +void NumberFormatConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -32,8 +32,6 @@ ThrowCompletionOr NumberFormatConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 15.1.1 Intl.NumberFormat ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-intl.numberformat diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h index 382f68017a..92014e80cf 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.h @@ -15,7 +15,7 @@ class NumberFormatConstructor final : public NativeFunction { JS_OBJECT(NumberFormatConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~NumberFormatConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp index 9affae90fe..16cfadb39f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.cpp @@ -22,15 +22,13 @@ NumberFormatFunction::NumberFormatFunction(NumberFormat& number_format, Object& { } -ThrowCompletionOr NumberFormatFunction::initialize(Realm& realm) +void NumberFormatFunction::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); define_direct_property(vm.names.name, PrimitiveString::create(vm, String {}), Attribute::Configurable); - - return {}; } ThrowCompletionOr NumberFormatFunction::call() diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h index 239d9971a1..4dd161bf48 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatFunction.h @@ -19,7 +19,7 @@ public: static NonnullGCPtr create(Realm&, NumberFormat&); virtual ~NumberFormatFunction() override = default; - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp index 7f8eb3dc7c..b583d7620b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp @@ -19,14 +19,14 @@ NumberFormatPrototype::NumberFormatPrototype(Realm& realm) { } -ThrowCompletionOr NumberFormatPrototype::initialize(Realm& realm) +void NumberFormatPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 15.3.2 Intl.NumberFormat.prototype [ @@toStringTag ], https://tc39.es/ecma402/#sec-intl.numberformat.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.NumberFormat"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.NumberFormat"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.format, format, nullptr, Attribute::Configurable); @@ -35,8 +35,6 @@ ThrowCompletionOr NumberFormatPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.formatRange, format_range, 2, attr); define_native_function(realm, vm.names.formatRangeToParts, format_range_to_parts, 2, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 15.3.3 get Intl.NumberFormat.prototype.format, https://tc39.es/ecma402/#sec-intl.numberformat.prototype.format diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h index d022b0d558..4f5740662a 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.h @@ -15,7 +15,7 @@ class NumberFormatPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~NumberFormatPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp index 83452ba49b..63ae9d3291 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp @@ -21,9 +21,9 @@ PluralRulesConstructor::PluralRulesConstructor(Realm& realm) { } -ThrowCompletionOr PluralRulesConstructor::initialize(Realm& realm) +void PluralRulesConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -33,8 +33,6 @@ ThrowCompletionOr PluralRulesConstructor::initialize(Realm& realm) u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); - - return {}; } // 16.1.1 Intl.PluralRules ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-intl.pluralrules diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h index 8c5c69fd5d..256f38d73d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.h @@ -14,7 +14,7 @@ class PluralRulesConstructor final : public NativeFunction { JS_OBJECT(PluralRulesConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PluralRulesConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp index 01713f5ee2..a98f66a512 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp @@ -18,21 +18,19 @@ PluralRulesPrototype::PluralRulesPrototype(Realm& realm) { } -ThrowCompletionOr PluralRulesPrototype::initialize(Realm& realm) +void PluralRulesPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Object::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 16.3.2 Intl.PluralRules.prototype [ @@toStringTag ], https://tc39.es/ecma402/#sec-intl.pluralrules.prototype-tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.PluralRules"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.PluralRules"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.select, select, 1, attr); define_native_function(realm, vm.names.selectRange, select_range, 2, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 16.3.3 Intl.PluralRules.prototype.select ( value ), https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.select diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h index ad62242b2d..5c48fa106e 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.h @@ -15,7 +15,7 @@ class PluralRulesPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PluralRulesPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp index 6803679d13..147b017092 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp @@ -24,9 +24,9 @@ RelativeTimeFormatConstructor::RelativeTimeFormatConstructor(Realm& realm) { } -ThrowCompletionOr RelativeTimeFormatConstructor::initialize(Realm& realm) +void RelativeTimeFormatConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -36,8 +36,6 @@ ThrowCompletionOr RelativeTimeFormatConstructor::initialize(Realm& realm) u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); - - return {}; } // 17.1.1 Intl.RelativeTimeFormat ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h index 65d910529d..9459dc1fde 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.h @@ -14,7 +14,7 @@ class RelativeTimeFormatConstructor final : public NativeFunction { JS_OBJECT(RelativeTimeFormatConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~RelativeTimeFormatConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp index d14ae25b72..893f856011 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp @@ -16,21 +16,19 @@ RelativeTimeFormatPrototype::RelativeTimeFormatPrototype(Realm& realm) { } -ThrowCompletionOr RelativeTimeFormatPrototype::initialize(Realm& realm) +void RelativeTimeFormatPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Object::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 17.3.2 Intl.RelativeTimeFormat.prototype[ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.prototype-toStringTag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.RelativeTimeFormat"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.RelativeTimeFormat"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.format, format, 2, attr); define_native_function(realm, vm.names.formatToParts, format_to_parts, 2, attr); define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); - - return {}; } // 17.3.3 Intl.RelativeTimeFormat.prototype.format ( value, unit ), https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.prototype.format diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h index 454f9aebda..4012ed2184 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.h @@ -15,7 +15,7 @@ class RelativeTimeFormatPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~RelativeTimeFormatPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp index 41f98a7edd..8cea3ea332 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.cpp @@ -18,19 +18,17 @@ SegmentIteratorPrototype::SegmentIteratorPrototype(Realm& realm) { } -ThrowCompletionOr SegmentIteratorPrototype::initialize(Realm& realm) +void SegmentIteratorPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Object::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 18.6.2.2 %SegmentIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma402/#sec-%segmentiteratorprototype%.@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Segmenter String Iterator"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Segmenter String Iterator"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.next, next, 0, attr); - - return {}; } // 18.6.2.1 %SegmentIteratorPrototype%.next ( ), https://tc39.es/ecma402/#sec-%segmentiteratorprototype%.next diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h index 88d60e4e50..6be503d84f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentIteratorPrototype.h @@ -15,7 +15,7 @@ class SegmentIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SegmentIteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp index 8bc8b6c005..6a390408a5 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp @@ -21,9 +21,9 @@ SegmenterConstructor::SegmenterConstructor(Realm& realm) { } -ThrowCompletionOr SegmenterConstructor::initialize(Realm& realm) +void SegmenterConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -33,8 +33,6 @@ ThrowCompletionOr SegmenterConstructor::initialize(Realm& realm) u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.supportedLocalesOf, supported_locales_of, 1, attr); - - return {}; } // 18.1.1 Intl.Segmenter ( [ locales [ , options ] ] ), https://tc39.es/ecma402/#sec-intl.segmenter diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h index 1eda9940e1..6cd08b38c9 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.h @@ -14,7 +14,7 @@ class SegmenterConstructor final : public NativeFunction { JS_OBJECT(SegmenterConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SegmenterConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp index 4ad4b211ee..bc27c7a432 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.cpp @@ -17,20 +17,18 @@ SegmenterPrototype::SegmenterPrototype(Realm& realm) { } -ThrowCompletionOr SegmenterPrototype::initialize(Realm& realm) +void SegmenterPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 18.3.2 Intl.Segmenter.prototype [ @@toStringTag ], https://tc39.es/ecma402/#sec-intl.segmenter.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Intl.Segmenter"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Intl.Segmenter"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.resolvedOptions, resolved_options, 0, attr); define_native_function(realm, vm.names.segment, segment, 1, attr); - - return {}; } // 18.3.4 Intl.Segmenter.prototype.resolvedOptions ( ), https://tc39.es/ecma402/#sec-intl.segmenter.prototype.resolvedoptions diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h index 3447388963..672318f1cf 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterPrototype.h @@ -15,7 +15,7 @@ class SegmenterPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SegmenterPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp index 395dcef136..d3b9b07d4f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.cpp @@ -17,17 +17,15 @@ SegmentsPrototype::SegmentsPrototype(Realm& realm) { } -ThrowCompletionOr SegmentsPrototype::initialize(Realm& realm) +void SegmentsPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.well_known_symbol_iterator(), symbol_iterator, 0, attr); define_native_function(realm, vm.names.containing, containing, 1, attr); - - return {}; } // 18.5.2.1 %SegmentsPrototype%.containing ( index ), https://tc39.es/ecma402/#sec-%segmentsprototype%.containing diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h index 586fac1e91..24ca244130 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmentsPrototype.h @@ -15,7 +15,7 @@ class SegmentsPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SegmentsPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp b/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp index ef2da46459..48a603066d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intrinsics.cpp @@ -189,8 +189,8 @@ ThrowCompletionOr Intrinsics::initialize_intrinsics(Realm& realm) m_new_ordinary_function_prototype_object_shape->add_property_without_transition(vm.names.constructor, Attribute::Writable | Attribute::Configurable); // Normally Heap::allocate() takes care of this, but these are allocated via allocate_without_realm(). - MUST_OR_THROW_OOM(m_function_prototype->initialize(realm)); - MUST_OR_THROW_OOM(m_object_prototype->initialize(realm)); + m_function_prototype->initialize(realm); + m_object_prototype->initialize(realm); #define __JS_ENUMERATE(ClassName, snake_name) \ VERIFY(!m_##snake_name##_prototype); \ diff --git a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp index 038f3d47b2..8ad7ff1ad8 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.cpp @@ -20,9 +20,9 @@ IteratorConstructor::IteratorConstructor(Realm& realm) { } -ThrowCompletionOr IteratorConstructor::initialize(Realm& realm) +void IteratorConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -33,8 +33,6 @@ ThrowCompletionOr IteratorConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.from, from, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 3.1.1.1.1 Iterator ( ), https://tc39.es/proposal-iterator-helpers/#sec-iterator diff --git a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h index fd5baa65e1..44c324b9a0 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorConstructor.h @@ -15,7 +15,7 @@ class IteratorConstructor : public NativeFunction { JS_OBJECT(IteratorConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ThrowCompletionOr call() override; virtual ThrowCompletionOr> construct(FunctionObject& new_target) override; diff --git a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp index f3f7128b73..4d8f95ee0e 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.cpp @@ -15,19 +15,17 @@ IteratorHelperPrototype::IteratorHelperPrototype(Realm& realm) { } -ThrowCompletionOr IteratorHelperPrototype::initialize(Realm& realm) +void IteratorHelperPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.next, next, 0, attr); define_native_function(realm, vm.names.return_, return_, 0, attr); // 3.1.2.1.3 %IteratorHelperPrototype% [ @@toStringTag ], https://tc39.es/proposal-iterator-helpers/#sec-%iteratorhelperprototype%-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Iterator Helper"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Iterator Helper"sv)), Attribute::Configurable); } // 3.1.2.1.1 %IteratorHelperPrototype%.next ( ), https://tc39.es/proposal-iterator-helpers/#sec-%iteratorhelperprototype%.next diff --git a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h index 269ba7a6ff..8ec696f180 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorHelperPrototype.h @@ -15,7 +15,7 @@ class IteratorHelperPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; private: explicit IteratorHelperPrototype(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp index 2600d94fd0..7c689088af 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp @@ -21,13 +21,13 @@ IteratorPrototype::IteratorPrototype(Realm& realm) { } -ThrowCompletionOr IteratorPrototype::initialize(Realm& realm) +void IteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // 3.1.3.13 Iterator.prototype [ @@toStringTag ], https://tc39.es/proposal-iterator-helpers/#sec-iteratorprototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Iterator"sv)), Attribute::Configurable | Attribute::Writable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Iterator"sv)), Attribute::Configurable | Attribute::Writable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.well_known_symbol_iterator(), symbol_iterator, 0, attr); @@ -42,8 +42,6 @@ ThrowCompletionOr IteratorPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.some, some, 1, attr); define_native_function(realm, vm.names.every, every, 1, attr); define_native_function(realm, vm.names.find, find, 1, attr); - - return {}; } // 27.1.2.1 %IteratorPrototype% [ @@iterator ] ( ), https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h index 6aafb7ac33..87ca187d30 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h @@ -15,7 +15,7 @@ class IteratorPrototype : public PrototypeObject { JS_PROTOTYPE_OBJECT(IteratorPrototype, Iterator, Iterator); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~IteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index 439ddff43a..36f2417c7f 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -31,18 +31,16 @@ JSONObject::JSONObject(Realm& realm) { } -ThrowCompletionOr JSONObject::initialize(Realm& realm) +void JSONObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.stringify, stringify, 3, attr); define_native_function(realm, vm.names.parse, parse, 2, attr); // 25.5.3 JSON [ @@toStringTag ], https://tc39.es/ecma262/#sec-json-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "JSON"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "JSON"sv)), Attribute::Configurable); } // 25.5.2 JSON.stringify ( value [ , replacer [ , space ] ] ), https://tc39.es/ecma262/#sec-json.stringify diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.h b/Userland/Libraries/LibJS/Runtime/JSONObject.h index 85ab019b06..490edac4c9 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.h +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.h @@ -14,7 +14,7 @@ class JSONObject final : public Object { JS_OBJECT(JSONObject, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~JSONObject() override = default; // The base implementation of stringify is exposed because it is used by diff --git a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp index 1a88ad81df..3ceb432e9a 100644 --- a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp @@ -19,10 +19,10 @@ MapConstructor::MapConstructor(Realm& realm) { } -ThrowCompletionOr MapConstructor::initialize(Realm& realm) +void MapConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 24.1.2.1 Map.prototype, https://tc39.es/ecma262/#sec-map.prototype define_direct_property(vm.names.prototype, realm.intrinsics().map_prototype(), 0); @@ -33,8 +33,6 @@ ThrowCompletionOr MapConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 24.1.1.1 Map ( [ iterable ] ), https://tc39.es/ecma262/#sec-map-iterable diff --git a/Userland/Libraries/LibJS/Runtime/MapConstructor.h b/Userland/Libraries/LibJS/Runtime/MapConstructor.h index 497e807d56..ff0bbaea92 100644 --- a/Userland/Libraries/LibJS/Runtime/MapConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/MapConstructor.h @@ -14,7 +14,7 @@ class MapConstructor final : public NativeFunction { JS_OBJECT(MapConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~MapConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp index 258385303e..748b96056e 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp @@ -18,15 +18,13 @@ MapIteratorPrototype::MapIteratorPrototype(Realm& realm) { } -ThrowCompletionOr MapIteratorPrototype::initialize(Realm& realm) +void MapIteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_function(realm, vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Map Iterator"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Map Iterator"sv)), Attribute::Configurable); } // 24.1.5.2.1 %MapIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%mapiteratorprototype%.next diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h index 7b66b9b4b0..5f1e1db3c7 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h @@ -15,7 +15,7 @@ class MapIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~MapIteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp index 4dff35c5b7..8258d950b0 100644 --- a/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp @@ -17,10 +17,10 @@ MapPrototype::MapPrototype(Realm& realm) { } -ThrowCompletionOr MapPrototype::initialize(Realm& realm) +void MapPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.clear, clear, 0, attr); @@ -37,8 +37,6 @@ ThrowCompletionOr MapPrototype::initialize(Realm& realm) define_direct_property(vm.well_known_symbol_iterator(), get_without_side_effects(vm.names.entries), attr); define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.Map.as_string()), Attribute::Configurable); - - return {}; } // 24.1.3.1 Map.prototype.clear ( ), https://tc39.es/ecma262/#sec-map.prototype.clear diff --git a/Userland/Libraries/LibJS/Runtime/MapPrototype.h b/Userland/Libraries/LibJS/Runtime/MapPrototype.h index 5997e8078e..53a32640dc 100644 --- a/Userland/Libraries/LibJS/Runtime/MapPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/MapPrototype.h @@ -15,7 +15,7 @@ class MapPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(MapPrototype, Map, Map); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~MapPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/MathObject.cpp b/Userland/Libraries/LibJS/Runtime/MathObject.cpp index 4bb509779a..6c60c2ba50 100644 --- a/Userland/Libraries/LibJS/Runtime/MathObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/MathObject.cpp @@ -21,10 +21,10 @@ MathObject::MathObject(Realm& realm) { } -ThrowCompletionOr MathObject::initialize(Realm& realm) +void MathObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.abs, abs, 1, attr); define_native_function(realm, vm.names.random, random, 0, attr); @@ -74,8 +74,6 @@ ThrowCompletionOr MathObject::initialize(Realm& realm) // 21.3.1.9 Math [ @@toStringTag ], https://tc39.es/ecma262/#sec-math-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.Math.as_string()), Attribute::Configurable); - - return {}; } // 21.3.2.1 Math.abs ( x ), https://tc39.es/ecma262/#sec-math.abs diff --git a/Userland/Libraries/LibJS/Runtime/MathObject.h b/Userland/Libraries/LibJS/Runtime/MathObject.h index 8113347274..a7253a5ba9 100644 --- a/Userland/Libraries/LibJS/Runtime/MathObject.h +++ b/Userland/Libraries/LibJS/Runtime/MathObject.h @@ -14,7 +14,7 @@ class MathObject final : public Object { JS_OBJECT(MathObject, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~MathObject() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp index 5917d9bba8..2a7bbcae8f 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.cpp @@ -22,15 +22,13 @@ ModuleNamespaceObject::ModuleNamespaceObject(Realm& realm, Module* module, Vecto }); } -ThrowCompletionOr ModuleNamespaceObject::initialize(Realm& realm) +void ModuleNamespaceObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // 28.3.1 @@toStringTag, https://tc39.es/ecma262/#sec-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Module"sv)), 0); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Module"sv)), 0); } // 10.4.6.1 [[GetPrototypeOf]] ( ), https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-getprototypeof diff --git a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h index d6dd3bce04..7f317ffe50 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleNamespaceObject.h @@ -29,7 +29,7 @@ public: virtual ThrowCompletionOr internal_set(PropertyKey const&, Value value, Value receiver) override; virtual ThrowCompletionOr internal_delete(PropertyKey const&) override; virtual ThrowCompletionOr> internal_own_property_keys() const override; - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; private: ModuleNamespaceObject(Realm&, Module* module, Vector exports); diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.h b/Userland/Libraries/LibJS/Runtime/NativeFunction.h index 49c3bb2698..d4eb48596f 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeFunction.h +++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.h @@ -23,7 +23,6 @@ public: static NonnullGCPtr create(Realm&, SafeFunction(VM&)> behaviour, i32 length, PropertyKey const& name, Optional = {}, Optional prototype = {}, Optional const& prefix = {}); static NonnullGCPtr create(Realm&, DeprecatedFlyString const& name, SafeFunction(VM&)>); - virtual ThrowCompletionOr initialize(Realm&) override { return {}; } virtual ~NativeFunction() override = default; virtual ThrowCompletionOr internal_call(Value this_argument, MarkedVector arguments_list) override; diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp index de2ce50bd2..da3f2ceb51 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp @@ -29,10 +29,10 @@ NumberConstructor::NumberConstructor(Realm& realm) { } -ThrowCompletionOr NumberConstructor::initialize(Realm& realm) +void NumberConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 21.1.2.15 Number.prototype, https://tc39.es/ecma262/#sec-number.prototype define_direct_property(vm.names.prototype, realm.intrinsics().number_prototype(), 0); @@ -54,8 +54,6 @@ ThrowCompletionOr NumberConstructor::initialize(Realm& realm) define_direct_property(vm.names.NaN, js_nan(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // Most of 21.1.1.1 Number ( value ) factored into a separate function for sharing between call() and construct(). diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.h b/Userland/Libraries/LibJS/Runtime/NumberConstructor.h index 54144d08ac..45d32f1e21 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.h @@ -14,7 +14,7 @@ class NumberConstructor final : public NativeFunction { JS_OBJECT(NumberConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~NumberConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp index c4035f3d51..eed94f8191 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp @@ -42,10 +42,10 @@ NumberPrototype::NumberPrototype(Realm& realm) { } -ThrowCompletionOr NumberPrototype::initialize(Realm& realm) +void NumberPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Configurable | Attribute::Writable; define_native_function(realm, vm.names.toExponential, to_exponential, 1, attr); define_native_function(realm, vm.names.toFixed, to_fixed, 1, attr); @@ -53,8 +53,6 @@ ThrowCompletionOr NumberPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toPrecision, to_precision, 1, attr); define_native_function(realm, vm.names.toString, to_string, 1, attr); define_native_function(realm, vm.names.valueOf, value_of, 0, attr); - - return {}; } // thisNumberValue ( value ), https://tc39.es/ecma262/#thisnumbervalue diff --git a/Userland/Libraries/LibJS/Runtime/NumberPrototype.h b/Userland/Libraries/LibJS/Runtime/NumberPrototype.h index d396e43fac..22139df606 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/NumberPrototype.h @@ -14,7 +14,7 @@ class NumberPrototype final : public NumberObject { JS_OBJECT(NumberPrototype, NumberObject); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~NumberPrototype() override = default; JS_DECLARE_NATIVE_FUNCTION(to_exponential); diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index a0fdd8481d..6e7053203f 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -74,9 +74,8 @@ Object::~Object() s_intrinsics.remove(this); } -ThrowCompletionOr Object::initialize(Realm&) +void Object::initialize(Realm&) { - return {}; } // 7.2 Testing and Comparison Operations, https://tc39.es/ecma262/#sec-testing-and-comparison-operations diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 31bea5e02a..ce55de9e59 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -57,7 +57,7 @@ class Object : public Cell { public: static NonnullGCPtr create(Realm&, Object* prototype); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~Object(); enum class PropertyKind { diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index b741c62f11..74cd6c56c2 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -22,10 +22,10 @@ ObjectConstructor::ObjectConstructor(Realm& realm) { } -ThrowCompletionOr ObjectConstructor::initialize(Realm& realm) +void ObjectConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 20.1.2.19 Object.prototype, https://tc39.es/ecma262/#sec-object.prototype define_direct_property(vm.names.prototype, realm.intrinsics().object_prototype(), 0); @@ -56,8 +56,6 @@ ThrowCompletionOr ObjectConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.assign, assign, 2, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 20.1.1.1 Object ( [ value ] ), https://tc39.es/ecma262/#sec-object-value diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h index 6f9e1f7947..10ff73ff3c 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.h @@ -15,7 +15,7 @@ class ObjectConstructor final : public NativeFunction { JS_OBJECT(ObjectConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ObjectConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp index addd958b37..39daa3f613 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp @@ -26,10 +26,10 @@ ObjectPrototype::ObjectPrototype(Realm& realm) { } -ThrowCompletionOr ObjectPrototype::initialize(Realm& realm) +void ObjectPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // This must be called after the constructor has returned, so that the below code // can find the ObjectPrototype through normal paths. u8 attr = Attribute::Writable | Attribute::Configurable; @@ -46,8 +46,6 @@ ThrowCompletionOr ObjectPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.__lookupGetter__, lookup_getter, 1, attr); define_native_function(realm, vm.names.__lookupSetter__, lookup_setter, 1, attr); define_native_accessor(realm, vm.names.__proto__, proto_getter, proto_setter, Attribute::Configurable); - - return {}; } // 10.4.7.1 [[SetPrototypeOf]] ( V ), https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects-setprototypeof-v diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h index c64f8f0d59..abb3a4976c 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.h @@ -15,7 +15,7 @@ class ObjectPrototype final : public Object { JS_OBJECT(ObjectPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ObjectPrototype() override = default; // 10.4.7 Immutable Prototype Exotic Objects, https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index 6cc318e835..23a9092c45 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -244,10 +244,10 @@ PromiseConstructor::PromiseConstructor(Realm& realm) { } -ThrowCompletionOr PromiseConstructor::initialize(Realm& realm) +void PromiseConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 27.2.4.4 Promise.prototype, https://tc39.es/ecma262/#sec-promise.prototype define_direct_property(vm.names.prototype, realm.intrinsics().promise_prototype(), 0); @@ -264,8 +264,6 @@ ThrowCompletionOr PromiseConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 27.2.3.1 Promise ( executor ), https://tc39.es/ecma262/#sec-promise-executor diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h index 4f81ed64f5..01158d2582 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.h @@ -14,7 +14,7 @@ class PromiseConstructor final : public NativeFunction { JS_OBJECT(PromiseConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PromiseConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp index a95b5e3a64..a32a4bbc10 100644 --- a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp @@ -21,10 +21,10 @@ PromisePrototype::PromisePrototype(Realm& realm) { } -ThrowCompletionOr PromisePrototype::initialize(Realm& realm) +void PromisePrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.then, then, 2, attr); @@ -33,8 +33,6 @@ ThrowCompletionOr PromisePrototype::initialize(Realm& realm) // 27.2.5.5 Promise.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-promise.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.Promise.as_string()), Attribute::Configurable); - - return {}; } // 27.2.5.4 Promise.prototype.then ( onFulfilled, onRejected ), https://tc39.es/ecma262/#sec-promise.prototype.then diff --git a/Userland/Libraries/LibJS/Runtime/PromisePrototype.h b/Userland/Libraries/LibJS/Runtime/PromisePrototype.h index 94edd3826c..9fc359d8cf 100644 --- a/Userland/Libraries/LibJS/Runtime/PromisePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/PromisePrototype.h @@ -14,7 +14,7 @@ class PromisePrototype final : public PrototypeObject JS_PROTOTYPE_OBJECT(PromisePrototype, Promise, Promise); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PromisePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp index f50c486b91..0f53204e75 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp @@ -29,12 +29,10 @@ PromiseResolvingElementFunction::PromiseResolvingElementFunction(size_t index, P { } -ThrowCompletionOr PromiseResolvingElementFunction::initialize(Realm& realm) +void PromiseResolvingElementFunction::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property(vm().names.length, Value(1), Attribute::Configurable); - - return {}; } ThrowCompletionOr PromiseResolvingElementFunction::call() diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h index 95663c00f9..40b2f0cf07 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.h @@ -45,7 +45,7 @@ class PromiseResolvingElementFunction : public NativeFunction { JS_OBJECT(PromiseResolvingFunction, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PromiseResolvingElementFunction() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp index 5194613230..d0b636731b 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp @@ -24,12 +24,10 @@ PromiseResolvingFunction::PromiseResolvingFunction(Promise& promise, AlreadyReso { } -ThrowCompletionOr PromiseResolvingFunction::initialize(Realm& realm) +void PromiseResolvingFunction::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property(vm().names.length, Value(1), Attribute::Configurable); - - return {}; } ThrowCompletionOr PromiseResolvingFunction::call() diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h index 864c8e3977..e73e550b4d 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h @@ -30,7 +30,7 @@ public: static NonnullGCPtr create(Realm&, Promise&, AlreadyResolved&, FunctionType); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PromiseResolvingFunction() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp index a57117cec9..d40a50bfa6 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp @@ -43,16 +43,14 @@ ProxyConstructor::ProxyConstructor(Realm& realm) { } -ThrowCompletionOr ProxyConstructor::initialize(Realm& realm) +void ProxyConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.revocable, revocable, 2, attr); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); - - return {}; } // 28.2.1.1 Proxy ( target, handler ), https://tc39.es/ecma262/#sec-proxy-target-handler diff --git a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h index 25699cf761..46414bee0f 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.h @@ -15,7 +15,7 @@ class ProxyConstructor final : public NativeFunction { JS_OBJECT(ProxyConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ProxyConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Realm.cpp b/Userland/Libraries/LibJS/Runtime/Realm.cpp index c642387dfc..3d92c25b59 100644 --- a/Userland/Libraries/LibJS/Runtime/Realm.cpp +++ b/Userland/Libraries/LibJS/Runtime/Realm.cpp @@ -75,7 +75,7 @@ ThrowCompletionOr> Realm::initialize_host_define auto& global_object = set_default_global_bindings(*realm); // 11. Create any host-defined global object properties on globalObj. - MUST_OR_THROW_OOM(global_object.initialize(*realm)); + global_object.initialize(*realm); // 12. Return unused. return new_context; diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp index 0c644337ac..f7875c69d1 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp @@ -20,10 +20,10 @@ ReflectObject::ReflectObject(Realm& realm) { } -ThrowCompletionOr ReflectObject::initialize(Realm& realm) +void ReflectObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.apply, apply, 3, attr); define_native_function(realm, vm.names.construct, construct, 2, attr); @@ -41,8 +41,6 @@ ThrowCompletionOr ReflectObject::initialize(Realm& realm) // 28.1.14 Reflect [ @@toStringTag ], https://tc39.es/ecma262/#sec-reflect-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.Reflect.as_string()), Attribute::Configurable); - - return {}; } // 28.1.1 Reflect.apply ( target, thisArgument, argumentsList ), https://tc39.es/ecma262/#sec-reflect.apply diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.h b/Userland/Libraries/LibJS/Runtime/ReflectObject.h index cce1defea3..4f0058e930 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.h +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.h @@ -14,7 +14,7 @@ class ReflectObject final : public Object { JS_OBJECT(ReflectObject, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ReflectObject() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp index 1f02d77f3c..a6c0b0964a 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp @@ -17,10 +17,10 @@ RegExpConstructor::RegExpConstructor(Realm& realm) { } -ThrowCompletionOr RegExpConstructor::initialize(Realm& realm) +void RegExpConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 22.2.5.1 RegExp.prototype, https://tc39.es/ecma262/#sec-regexp.prototype define_direct_property(vm.names.prototype, realm.intrinsics().regexp_prototype(), 0); @@ -49,8 +49,6 @@ ThrowCompletionOr RegExpConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.names.$7, group_7_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.$8, group_8_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.$9, group_9_getter, {}, Attribute::Configurable); - - return {}; } // 22.2.4.1 RegExp ( pattern, flags ), https://tc39.es/ecma262/#sec-regexp-pattern-flags diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h index 90bae1f8d9..a754513739 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.h @@ -15,7 +15,7 @@ class RegExpConstructor final : public NativeFunction { JS_OBJECT(RegExpConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~RegExpConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index 48070b4438..d05d7e6294 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -154,14 +154,12 @@ RegExpObject::RegExpObject(Regex regex, DeprecatedString pattern, Depre VERIFY(m_regex->parser_result.error == regex::Error::NoError); } -ThrowCompletionOr RegExpObject::initialize(Realm& realm) +void RegExpObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property(vm.names.lastIndex, Value(0), Attribute::Writable); - - return {}; } // 22.2.3.3 RegExpInitialize ( obj, pattern, flags ), https://tc39.es/ecma262/#sec-regexpinitialize diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.h b/Userland/Libraries/LibJS/Runtime/RegExpObject.h index b93ca70624..eadb108e53 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.h @@ -42,7 +42,7 @@ public: ThrowCompletionOr> regexp_initialize(VM&, Value pattern, Value flags); DeprecatedString escape_regexp_pattern() const; - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~RegExpObject() override = default; DeprecatedString const& pattern() const { return m_pattern; } diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index af207b8624..7188e29de3 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -27,10 +27,10 @@ RegExpPrototype::RegExpPrototype(Realm& realm) { } -ThrowCompletionOr RegExpPrototype::initialize(Realm& realm) +void RegExpPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.toString, to_string, 0, attr); @@ -51,8 +51,6 @@ ThrowCompletionOr RegExpPrototype::initialize(Realm& realm) define_native_accessor(realm, vm.names.flagName, flag_name, {}, Attribute::Configurable); JS_ENUMERATE_REGEXP_FLAGS #undef __JS_ENUMERATE - - return {}; } // Non-standard abstraction around steps used by multiple prototypes. diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h index 79d8683546..69bbb6b14e 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.h @@ -19,7 +19,7 @@ class RegExpPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~RegExpPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp index 36d0a78b1b..80ddafa28c 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp @@ -17,18 +17,16 @@ RegExpStringIteratorPrototype::RegExpStringIteratorPrototype(Realm& realm) { } -ThrowCompletionOr RegExpStringIteratorPrototype::initialize(Realm& realm) +void RegExpStringIteratorPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.next, next, 0, attr); // 22.2.9.2.2 %RegExpStringIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%regexpstringiteratorprototype%-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "RegExp String Iterator"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "RegExp String Iterator"sv)), Attribute::Configurable); } // 22.2.9.2.1 %RegExpStringIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%regexpstringiteratorprototype%.next diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h index 2a464902e0..77ac5f678d 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.h @@ -17,7 +17,7 @@ class RegExpStringIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; private: explicit RegExpStringIteratorPrototype(Realm&); diff --git a/Userland/Libraries/LibJS/Runtime/Set.cpp b/Userland/Libraries/LibJS/Runtime/Set.cpp index 3defd113eb..ab39498fc9 100644 --- a/Userland/Libraries/LibJS/Runtime/Set.cpp +++ b/Userland/Libraries/LibJS/Runtime/Set.cpp @@ -18,11 +18,9 @@ Set::Set(Object& prototype) { } -ThrowCompletionOr Set::initialize(Realm& realm) +void Set::initialize(Realm& realm) { m_values = Map::create(realm); - - return {}; } NonnullGCPtr Set::copy() const diff --git a/Userland/Libraries/LibJS/Runtime/Set.h b/Userland/Libraries/LibJS/Runtime/Set.h index 8fec5efa49..fc00ad687e 100644 --- a/Userland/Libraries/LibJS/Runtime/Set.h +++ b/Userland/Libraries/LibJS/Runtime/Set.h @@ -19,7 +19,7 @@ class Set : public Object { public: static NonnullGCPtr create(Realm&); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~Set() override = default; // NOTE: Unlike what the spec says, we implement Sets using an underlying map, diff --git a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp index 684aa70804..d71728af2f 100644 --- a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp @@ -18,10 +18,10 @@ SetConstructor::SetConstructor(Realm& realm) { } -ThrowCompletionOr SetConstructor::initialize(Realm& realm) +void SetConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 24.2.2.1 Set.prototype, https://tc39.es/ecma262/#sec-set.prototype define_direct_property(vm.names.prototype, realm.intrinsics().set_prototype(), 0); @@ -29,8 +29,6 @@ ThrowCompletionOr SetConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 24.2.1.1 Set ( [ iterable ] ), https://tc39.es/ecma262/#sec-set-iterable diff --git a/Userland/Libraries/LibJS/Runtime/SetConstructor.h b/Userland/Libraries/LibJS/Runtime/SetConstructor.h index ef596954dd..b11a2cf90d 100644 --- a/Userland/Libraries/LibJS/Runtime/SetConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SetConstructor.h @@ -14,7 +14,7 @@ class SetConstructor final : public NativeFunction { JS_OBJECT(SetConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SetConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp index 321d9482a5..b699cc68c6 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp @@ -18,17 +18,15 @@ SetIteratorPrototype::SetIteratorPrototype(Realm& realm) { } -ThrowCompletionOr SetIteratorPrototype::initialize(Realm& realm) +void SetIteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_function(realm, vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); // 24.2.5.2.2 %SetIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%setiteratorprototype%-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Set Iterator"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Set Iterator"sv)), Attribute::Configurable); } // 24.2.5.2.1 %SetIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%setiteratorprototype%.next diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h index e71a2b1ee3..4bf9e6b85b 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h @@ -15,7 +15,7 @@ class SetIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SetIteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp index cfa13dc335..93f72bc174 100644 --- a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp @@ -19,10 +19,10 @@ SetPrototype::SetPrototype(Realm& realm) { } -ThrowCompletionOr SetPrototype::initialize(Realm& realm) +void SetPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.add, add, 1, attr); @@ -48,8 +48,6 @@ ThrowCompletionOr SetPrototype::initialize(Realm& realm) // 24.2.3.12 Set.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-set.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.Set.as_string()), Attribute::Configurable); - - return {}; } // 24.2.3.1 Set.prototype.add ( value ), https://tc39.es/ecma262/#sec-set.prototype.add diff --git a/Userland/Libraries/LibJS/Runtime/SetPrototype.h b/Userland/Libraries/LibJS/Runtime/SetPrototype.h index df9ca0da90..24708ba481 100644 --- a/Userland/Libraries/LibJS/Runtime/SetPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SetPrototype.h @@ -15,7 +15,7 @@ class SetPrototype final : public PrototypeObject { JS_PROTOTYPE_OBJECT(SetPrototype, Set, Set); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SetPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp index 49d9c6e591..8458fa34d9 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp @@ -16,17 +16,15 @@ ShadowRealmConstructor::ShadowRealmConstructor(Realm& realm) { } -ThrowCompletionOr ShadowRealmConstructor::initialize(Realm& realm) +void ShadowRealmConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 3.3.1 ShadowRealm.prototype, https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype define_direct_property(vm.names.prototype, realm.intrinsics().shadow_realm_prototype(), 0); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 3.2.1 ShadowRealm ( ), https://tc39.es/proposal-shadowrealm/#sec-shadowrealm @@ -70,7 +68,7 @@ ThrowCompletionOr> ShadowRealmConstructor::construct(Functi auto& global_object = set_default_global_bindings(object->shadow_realm()); // FIXME: 12. Perform ? HostInitializeShadowRealm(O.[[ShadowRealm]]). - MUST_OR_THROW_OOM(global_object.initialize(object->shadow_realm())); + global_object.initialize(object->shadow_realm()); // 13. Return O. return object; diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h index f7f5688aec..16fae21238 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.h @@ -14,7 +14,7 @@ class ShadowRealmConstructor final : public NativeFunction { JS_OBJECT(ShadowRealmConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ShadowRealmConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp index 46cab4d73d..30cd69b032 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp @@ -16,10 +16,10 @@ ShadowRealmPrototype::ShadowRealmPrototype(Realm& realm) { } -ThrowCompletionOr ShadowRealmPrototype::initialize(Realm& realm) +void ShadowRealmPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.evaluate, evaluate, 1, attr); @@ -27,8 +27,6 @@ ThrowCompletionOr ShadowRealmPrototype::initialize(Realm& realm) // 3.4.3 ShadowRealm.prototype [ @@toStringTag ], https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.ShadowRealm.as_string()), Attribute::Configurable); - - return {}; } // 3.4.1 ShadowRealm.prototype.evaluate ( sourceText ), https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype.evaluate diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h index b55a0e86be..6e85ad4089 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.h @@ -15,7 +15,7 @@ class ShadowRealmPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ShadowRealmPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp index 018d067508..23ce827e4d 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.cpp @@ -19,10 +19,10 @@ SharedArrayBufferConstructor::SharedArrayBufferConstructor(Realm& realm) { } -ThrowCompletionOr SharedArrayBufferConstructor::initialize(Realm& realm) +void SharedArrayBufferConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 25.2.4.2 SharedArrayBuffer.prototype, https://tc39.es/ecma262/#sec-sharedarraybuffer.prototype define_direct_property(vm.names.prototype, realm.intrinsics().shared_array_buffer_prototype(), 0); @@ -31,8 +31,6 @@ ThrowCompletionOr SharedArrayBufferConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 25.2.2.1 SharedArrayBuffer ( length ), https://tc39.es/ecma262/#sec-sharedarraybuffer-length diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h index b342787731..9f3a932892 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferConstructor.h @@ -14,7 +14,7 @@ class SharedArrayBufferConstructor final : public NativeFunction { JS_OBJECT(SharedArrayBufferConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SharedArrayBufferConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp index 7607e8cfc3..4b91553503 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.cpp @@ -17,19 +17,17 @@ SharedArrayBufferPrototype::SharedArrayBufferPrototype(Realm& realm) { } -ThrowCompletionOr SharedArrayBufferPrototype::initialize(Realm& realm) +void SharedArrayBufferPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_accessor(realm, vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); define_native_function(realm, vm.names.slice, slice, 2, attr); // 25.2.4.4 SharedArrayBuffer.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-sharedarraybuffer.prototype.toString define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.SharedArrayBuffer.as_string()), Attribute::Configurable); - - return {}; } // 25.2.4.1 get SharedArrayBuffer.prototype.byteLength, https://tc39.es/ecma262/#sec-get-sharedarraybuffer.prototype.bytelength diff --git a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h index e50e7b4c01..f6327d0a21 100644 --- a/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SharedArrayBufferPrototype.h @@ -15,7 +15,7 @@ class SharedArrayBufferPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SharedArrayBufferPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index 716e0e6aa2..315cb23c11 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -22,10 +22,10 @@ StringConstructor::StringConstructor(Realm& realm) { } -ThrowCompletionOr StringConstructor::initialize(Realm& realm) +void StringConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 22.1.2.3 String.prototype, https://tc39.es/ecma262/#sec-string.prototype define_direct_property(vm.names.prototype, realm.intrinsics().string_prototype(), 0); @@ -36,8 +36,6 @@ ThrowCompletionOr StringConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.fromCodePoint, from_code_point, 1, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 22.1.1.1 String ( value ), https://tc39.es/ecma262/#sec-string-constructor-string-value diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.h b/Userland/Libraries/LibJS/Runtime/StringConstructor.h index 3fb0ddb80f..f05574d541 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.h @@ -14,7 +14,7 @@ class StringConstructor final : public NativeFunction { JS_OBJECT(StringConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~StringConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp index e9f2d3c43a..7bd1126999 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp @@ -18,16 +18,14 @@ StringIteratorPrototype::StringIteratorPrototype(Realm& realm) { } -ThrowCompletionOr StringIteratorPrototype::initialize(Realm& realm) +void StringIteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_function(realm, vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); // 22.1.5.1.2 %StringIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%stringiteratorprototype%-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "String Iterator"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "String Iterator"sv)), Attribute::Configurable); } // 22.1.5.1.1 %StringIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h index 883710a359..3c7720786b 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h @@ -16,7 +16,7 @@ class StringIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~StringIteratorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.cpp b/Userland/Libraries/LibJS/Runtime/StringObject.cpp index d2abf47665..3849c66f4e 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringObject.cpp @@ -35,14 +35,12 @@ StringObject::StringObject(PrimitiveString& string, Object& prototype) { } -ThrowCompletionOr StringObject::initialize(Realm& realm) +void StringObject::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); - define_direct_property(vm.names.length, Value(MUST_OR_THROW_OOM(m_string->utf16_string_view()).length_in_code_units()), 0); - - return {}; + define_direct_property(vm.names.length, Value(MUST(m_string->utf16_string_view()).length_in_code_units()), 0); } void StringObject::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibJS/Runtime/StringObject.h b/Userland/Libraries/LibJS/Runtime/StringObject.h index 4e33e1937e..5774681933 100644 --- a/Userland/Libraries/LibJS/Runtime/StringObject.h +++ b/Userland/Libraries/LibJS/Runtime/StringObject.h @@ -16,7 +16,7 @@ class StringObject : public Object { public: static ThrowCompletionOr> create(Realm&, PrimitiveString&, Object& prototype); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~StringObject() override = default; PrimitiveString const& primitive_string() const { return m_string; } diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index 36025246d3..1da89ac3ae 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -163,10 +163,10 @@ StringPrototype::StringPrototype(Realm& realm) { } -ThrowCompletionOr StringPrototype::initialize(Realm& realm) +void StringPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(StringObject::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; // 22.1.3 Properties of the String Prototype Object, https://tc39.es/ecma262/#sec-properties-of-the-string-prototype-object @@ -223,8 +223,6 @@ ThrowCompletionOr StringPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.sup, sup, 0, attr); define_direct_property(vm.names.trimLeft, get_without_side_effects(vm.names.trimStart), attr); define_direct_property(vm.names.trimRight, get_without_side_effects(vm.names.trimEnd), attr); - - return {}; } // thisStringValue ( value ), https://tc39.es/ecma262/#thisstringvalue diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.h b/Userland/Libraries/LibJS/Runtime/StringPrototype.h index e7425523c9..76670eb3a8 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.h @@ -26,7 +26,7 @@ class StringPrototype final : public StringObject { public: explicit StringPrototype(Realm&); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~StringPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp index 184cc86c24..4ed600dbcd 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.cpp @@ -19,17 +19,15 @@ SuppressedErrorConstructor::SuppressedErrorConstructor(Realm& realm) { } -ThrowCompletionOr SuppressedErrorConstructor::initialize(Realm& realm) +void SuppressedErrorConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 10.1.4.2.1 SuppressedError.prototype, https://tc39.es/proposal-explicit-resource-management/#sec-suppressederror.prototype define_direct_property(vm.names.prototype, realm.intrinsics().suppressed_error_prototype(), 0); define_direct_property(vm.names.length, Value(3), Attribute::Configurable); - - return {}; } // 10.1.4.1.1 SuppressedError ( error, suppressed, message [ , options ] ), https://tc39.es/proposal-explicit-resource-management/#sec-suppressederror diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h index 3ee5d83073..f27672ed20 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorConstructor.h @@ -14,7 +14,7 @@ class SuppressedErrorConstructor final : public NativeFunction { JS_OBJECT(SuppressedErrorConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SuppressedErrorConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp index 2dce2448b5..eb29b5c14b 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.cpp @@ -15,15 +15,13 @@ SuppressedErrorPrototype::SuppressedErrorPrototype(Realm& realm) { } -ThrowCompletionOr SuppressedErrorPrototype::initialize(Realm& realm) +void SuppressedErrorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; - define_direct_property(vm.names.name, MUST_OR_THROW_OOM(PrimitiveString::create(vm, "SuppressedError"sv)), attr); + define_direct_property(vm.names.name, MUST(PrimitiveString::create(vm, "SuppressedError"sv)), attr); define_direct_property(vm.names.message, PrimitiveString::create(vm, String {}), attr); - - return {}; } } diff --git a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h index 83d01dbd5d..27791d6d7d 100644 --- a/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SuppressedErrorPrototype.h @@ -14,7 +14,7 @@ class SuppressedErrorPrototype final : public Object { JS_OBJECT(SuppressedErrorPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SuppressedErrorPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp index f9fc5c241b..cac5121ca9 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp @@ -16,10 +16,10 @@ SymbolConstructor::SymbolConstructor(Realm& realm) { } -ThrowCompletionOr SymbolConstructor::initialize(Realm& realm) +void SymbolConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 20.4.2.9 Symbol.prototype, https://tc39.es/ecma262/#sec-symbol.prototype define_direct_property(vm.names.prototype, realm.intrinsics().symbol_prototype(), 0); @@ -34,8 +34,6 @@ ThrowCompletionOr SymbolConstructor::initialize(Realm& realm) #undef __JS_ENUMERATE define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 20.4.1.1 Symbol ( [ description ] ), https://tc39.es/ecma262/#sec-symbol-description diff --git a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h index a80528124d..01fee91c62 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.h @@ -14,7 +14,7 @@ class SymbolConstructor final : public NativeFunction { JS_OBJECT(SymbolConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SymbolConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp index a684d64de7..839711c590 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp @@ -23,10 +23,10 @@ SymbolPrototype::SymbolPrototype(Realm& realm) { } -ThrowCompletionOr SymbolPrototype::initialize(Realm& realm) +void SymbolPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.toString, to_string, 0, attr); define_native_function(realm, vm.names.valueOf, value_of, 0, attr); @@ -34,9 +34,7 @@ ThrowCompletionOr SymbolPrototype::initialize(Realm& realm) define_native_function(realm, vm.well_known_symbol_to_primitive(), symbol_to_primitive, 1, Attribute::Configurable); // 20.4.3.6 Symbol.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Symbol"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Symbol"sv)), Attribute::Configurable); } // thisSymbolValue ( value ), https://tc39.es/ecma262/#thissymbolvalue diff --git a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h index d2997e322e..9f0bd4e8eb 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.h @@ -14,7 +14,7 @@ class SymbolPrototype final : public Object { JS_OBJECT(SymbolPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~SymbolPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp index 87b7d0db03..267d4148c7 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp @@ -16,9 +16,9 @@ CalendarConstructor::CalendarConstructor(Realm& realm) { } -ThrowCompletionOr CalendarConstructor::initialize(Realm& realm) +void CalendarConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -29,8 +29,6 @@ ThrowCompletionOr CalendarConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.from, from, 1, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 12.2.1 Temporal.Calendar ( id ), https://tc39.es/proposal-temporal/#sec-temporal.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h index e7dab014af..67476a8238 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.h @@ -14,7 +14,7 @@ class CalendarConstructor final : public NativeFunction { JS_OBJECT(CalendarConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~CalendarConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp index 66593cd301..4d23a2fcf5 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp @@ -29,14 +29,14 @@ CalendarPrototype::CalendarPrototype(Realm& realm) { } -ThrowCompletionOr CalendarPrototype::initialize(Realm& realm) +void CalendarPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 12.4.2 Temporal.Calendar.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.Calendar"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.Calendar"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.id, id_getter, {}, Attribute::Configurable); @@ -65,8 +65,6 @@ ThrowCompletionOr CalendarPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toJSON, to_json, 0, attr); define_native_function(realm, vm.names.era, era, 1, attr); define_native_function(realm, vm.names.eraYear, era_year, 1, attr); - - return {}; } // 12.4.3 get Temporal.Calendar.prototype.id, https://tc39.es/proposal-temporal/#sec-get-temporal.calendar.prototype.id diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h index 1765e74c39..38cc71dab1 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.h @@ -15,7 +15,7 @@ class CalendarPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~CalendarPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp index 488d6bb199..6204fe9932 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp @@ -19,9 +19,9 @@ DurationConstructor::DurationConstructor(Realm& realm) { } -ThrowCompletionOr DurationConstructor::initialize(Realm& realm) +void DurationConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -33,8 +33,6 @@ ThrowCompletionOr DurationConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 7.1.1 Temporal.Duration ( [ years [ , months [ , weeks [ , days [ , hours [ , minutes [ , seconds [ , milliseconds [ , microseconds [ , nanoseconds ] ] ] ] ] ] ] ] ] ] ), https://tc39.es/proposal-temporal/#sec-temporal.duration diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h index e4e8ecb78e..ffe4d78245 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.h @@ -14,7 +14,7 @@ class DurationConstructor final : public NativeFunction { JS_OBJECT(DurationConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DurationConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp index c7b1d6a077..a716ce5276 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp @@ -20,14 +20,14 @@ DurationPrototype::DurationPrototype(Realm& realm) { } -ThrowCompletionOr DurationPrototype::initialize(Realm& realm) +void DurationPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 7.3.2 Temporal.Duration.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.duration.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.Duration"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.Duration"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.years, years_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.months, months_getter, {}, Attribute::Configurable); @@ -54,8 +54,6 @@ ThrowCompletionOr DurationPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toJSON, to_json, 0, attr); define_native_function(realm, vm.names.toLocaleString, to_locale_string, 0, attr); define_native_function(realm, vm.names.valueOf, value_of, 0, attr); - - return {}; } // 7.3.3 get Temporal.Duration.prototype.years, https://tc39.es/proposal-temporal/#sec-get-temporal.duration.prototype.years diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h index f7867c14d8..07996aa841 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.h @@ -15,7 +15,7 @@ class DurationPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~DurationPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp index 342317027d..b83df05b5a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp @@ -18,9 +18,9 @@ InstantConstructor::InstantConstructor(Realm& realm) { } -ThrowCompletionOr InstantConstructor::initialize(Realm& realm) +void InstantConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -36,8 +36,6 @@ ThrowCompletionOr InstantConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 8.1.1 Temporal.Instant ( epochNanoseconds ), https://tc39.es/proposal-temporal/#sec-temporal.instant diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h index e66876ffcb..f6a1844040 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.h @@ -14,7 +14,7 @@ class InstantConstructor final : public NativeFunction { JS_OBJECT(InstantConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~InstantConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp index 8f8ff627d7..c705823d0c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp @@ -24,14 +24,14 @@ InstantPrototype::InstantPrototype(Realm& realm) { } -ThrowCompletionOr InstantPrototype::initialize(Realm& realm) +void InstantPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 8.3.2 Temporal.Instant.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.instant.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.Instant"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.Instant"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.epochSeconds, epoch_seconds_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.epochMilliseconds, epoch_milliseconds_getter, {}, Attribute::Configurable); @@ -51,8 +51,6 @@ ThrowCompletionOr InstantPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.valueOf, value_of, 0, attr); define_native_function(realm, vm.names.toZonedDateTime, to_zoned_date_time, 1, attr); define_native_function(realm, vm.names.toZonedDateTimeISO, to_zoned_date_time_iso, 1, attr); - - return {}; } // 8.3.3 get Temporal.Instant.prototype.epochSeconds, https://tc39.es/proposal-temporal/#sec-get-temporal.instant.prototype.epochseconds diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h index 09dc79ed2d..80899bd45d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.h @@ -15,7 +15,7 @@ class InstantPrototype final : public PrototypeObject JS_PROTOTYPE_OBJECT(InstantPrototype, Instant, Temporal.Instant); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~InstantPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp index 4c81971263..4824c9af79 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp @@ -26,14 +26,14 @@ Now::Now(Realm& realm) { } -ThrowCompletionOr Now::initialize(Realm& realm) +void Now::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 2.1.1 Temporal.Now [ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal-now-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.Now"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.Now"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.timeZone, time_zone, 0, attr); @@ -45,8 +45,6 @@ ThrowCompletionOr Now::initialize(Realm& realm) define_native_function(realm, vm.names.plainDate, plain_date, 1, attr); define_native_function(realm, vm.names.plainDateISO, plain_date_iso, 0, attr); define_native_function(realm, vm.names.plainTimeISO, plain_time_iso, 0, attr); - - return {}; } // 2.2.1 Temporal.Now.timeZone ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.timezone diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Now.h b/Userland/Libraries/LibJS/Runtime/Temporal/Now.h index 3413ff8be0..c6821b5c43 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Now.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Now.h @@ -15,7 +15,7 @@ class Now final : public Object { JS_OBJECT(Now, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~Now() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp index 72c194428f..eb430982e7 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp @@ -20,9 +20,9 @@ PlainDateConstructor::PlainDateConstructor(Realm& realm) { } -ThrowCompletionOr PlainDateConstructor::initialize(Realm& realm) +void PlainDateConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -34,8 +34,6 @@ ThrowCompletionOr PlainDateConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(3), Attribute::Configurable); - - return {}; } // 3.1.1 Temporal.PlainDate ( isoYear, isoMonth, isoDay [ , calendarLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.plaindate diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h index 58945ffb39..e6f13118a7 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.h @@ -14,7 +14,7 @@ class PlainDateConstructor final : public NativeFunction { JS_OBJECT(PlainDateConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainDateConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp index beee024c8c..91a8ba505d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp @@ -25,14 +25,14 @@ PlainDatePrototype::PlainDatePrototype(Realm& realm) { } -ThrowCompletionOr PlainDatePrototype::initialize(Realm& realm) +void PlainDatePrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 3.3.2 Temporal.PlainDate.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plaindate.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.PlainDate"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.PlainDate"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.calendar, calendar_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.year, year_getter, {}, Attribute::Configurable); @@ -68,8 +68,6 @@ ThrowCompletionOr PlainDatePrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toLocaleString, to_locale_string, 0, attr); define_native_function(realm, vm.names.toJSON, to_json, 0, attr); define_native_function(realm, vm.names.valueOf, value_of, 0, attr); - - return {}; } // 3.3.3 get Temporal.PlainDate.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plaindate.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h index 5048f300bd..dd3d45c837 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.h @@ -15,7 +15,7 @@ class PlainDatePrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainDatePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp index d69469f79d..4151718c9d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp @@ -20,9 +20,9 @@ PlainDateTimeConstructor::PlainDateTimeConstructor(Realm& realm) { } -ThrowCompletionOr PlainDateTimeConstructor::initialize(Realm& realm) +void PlainDateTimeConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -34,8 +34,6 @@ ThrowCompletionOr PlainDateTimeConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(3), Attribute::Configurable); - - return {}; } // 5.1.1 Temporal.PlainDateTime ( isoYear, isoMonth, isoDay [ , hour [ , minute [ , second [ , millisecond [ , microsecond [ , nanosecond [ , calendarLike ] ] ] ] ] ] ] ), https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h index 80e760fa20..d1f5bd67e5 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h @@ -14,7 +14,7 @@ class PlainDateTimeConstructor final : public NativeFunction { JS_OBJECT(PlainDateTimeConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainDateTimeConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp index 90049d115d..0187ee7c67 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp @@ -26,14 +26,14 @@ PlainDateTimePrototype::PlainDateTimePrototype(Realm& realm) { } -ThrowCompletionOr PlainDateTimePrototype::initialize(Realm& realm) +void PlainDateTimePrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 5.3.2 Temporal.PlainDateTime.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.PlainDateTime"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.PlainDateTime"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.calendar, calendar_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.year, year_getter, {}, Attribute::Configurable); @@ -79,8 +79,6 @@ ThrowCompletionOr PlainDateTimePrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); define_native_function(realm, vm.names.toPlainTime, to_plain_time, 0, attr); define_native_function(realm, vm.names.getISOFields, get_iso_fields, 0, attr); - - return {}; } // 5.3.3 get Temporal.PlainDateTime.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plaindatetime.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h index 6afc8dbee4..b657fa55e4 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.h @@ -15,7 +15,7 @@ class PlainDateTimePrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainDateTimePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp index c90829a4d1..c4c4c952f2 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp @@ -19,9 +19,9 @@ PlainMonthDayConstructor::PlainMonthDayConstructor(Realm& realm) { } -ThrowCompletionOr PlainMonthDayConstructor::initialize(Realm& realm) +void PlainMonthDayConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -32,8 +32,6 @@ ThrowCompletionOr PlainMonthDayConstructor::initialize(Realm& realm) u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.from, from, 1, attr); - - return {}; } // 10.1.1 Temporal.PlainMonthDay ( isoMonth, isoDay [ , calendarLike [ , referenceISOYear ] ] ), https://tc39.es/proposal-temporal/#sec-temporal.plainmonthday diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h index e16d9de2af..136c7d1526 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.h @@ -14,7 +14,7 @@ class PlainMonthDayConstructor final : public NativeFunction { JS_OBJECT(PlainMonthDayConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainMonthDayConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp index 5bc3139129..daf6708b39 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp @@ -20,14 +20,14 @@ PlainMonthDayPrototype::PlainMonthDayPrototype(Realm& realm) { } -ThrowCompletionOr PlainMonthDayPrototype::initialize(Realm& realm) +void PlainMonthDayPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 10.3.2 Temporal.PlainMonthDay.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plainmonthday.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.PlainMonthDay"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.PlainMonthDay"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.calendar, calendar_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); @@ -42,8 +42,6 @@ ThrowCompletionOr PlainMonthDayPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.valueOf, value_of, 0, attr); define_native_function(realm, vm.names.toPlainDate, to_plain_date, 1, attr); define_native_function(realm, vm.names.getISOFields, get_iso_fields, 0, attr); - - return {}; } // 10.3.3 get Temporal.PlainMonthDay.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plainmonthday.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h index 5559350c2d..c20cf81468 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.h @@ -15,7 +15,7 @@ class PlainMonthDayPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainMonthDayPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp index 1921237045..1505bb9adc 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp @@ -18,9 +18,9 @@ PlainTimeConstructor::PlainTimeConstructor(Realm& realm) { } -ThrowCompletionOr PlainTimeConstructor::initialize(Realm& realm) +void PlainTimeConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -32,8 +32,6 @@ ThrowCompletionOr PlainTimeConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 4.1.1 Temporal.PlainTime ( [ hour [ , minute [ , second [ , millisecond [ , microsecond [ , nanosecond ] ] ] ] ] ] ), https://tc39.es/proposal-temporal/#sec-temporal.plaintime diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h index 4a8c4b1e8b..0f03dec2db 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.h @@ -14,7 +14,7 @@ class PlainTimeConstructor final : public NativeFunction { JS_OBJECT(PlainTimeConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainTimeConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp index a8fd5ddc96..1b89f23a18 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp @@ -25,14 +25,14 @@ PlainTimePrototype::PlainTimePrototype(Realm& realm) { } -ThrowCompletionOr PlainTimePrototype::initialize(Realm& realm) +void PlainTimePrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 4.3.2 Temporal.PlainTime.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plaintime.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.PlainTime"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.PlainTime"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.calendar, calendar_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.hour, hour_getter, {}, Attribute::Configurable); @@ -57,8 +57,6 @@ ThrowCompletionOr PlainTimePrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toLocaleString, to_locale_string, 0, attr); define_native_function(realm, vm.names.toJSON, to_json, 0, attr); define_native_function(realm, vm.names.valueOf, value_of, 0, attr); - - return {}; } // 4.3.3 get Temporal.PlainTime.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plaintime.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h index 3b6c29fee5..00bdbf5423 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.h @@ -15,7 +15,7 @@ class PlainTimePrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainTimePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp index f92f77f20b..b200b6f970 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp @@ -20,9 +20,9 @@ PlainYearMonthConstructor::PlainYearMonthConstructor(Realm& realm) { } -ThrowCompletionOr PlainYearMonthConstructor::initialize(Realm& realm) +void PlainYearMonthConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -34,8 +34,6 @@ ThrowCompletionOr PlainYearMonthConstructor::initialize(Realm& realm) u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.from, from, 1, attr); define_native_function(realm, vm.names.compare, compare, 2, attr); - - return {}; } // 9.1.1 Temporal.PlainYearMonth ( isoYear, isoMonth [ , calendarLike [ , referenceISODay ] ] ), https://tc39.es/proposal-temporal/#sec-temporal.plainyearmonth diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h index 2a5f389f27..1f51297e27 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.h @@ -14,7 +14,7 @@ class PlainYearMonthConstructor final : public NativeFunction { JS_OBJECT(PlainYearMonthConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainYearMonthConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp index bf0ac5c1f5..50e8b4f539 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp @@ -22,14 +22,14 @@ PlainYearMonthPrototype::PlainYearMonthPrototype(Realm& realm) { } -ThrowCompletionOr PlainYearMonthPrototype::initialize(Realm& realm) +void PlainYearMonthPrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 9.3.2 Temporal.PlainYearMonth.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plainyearmonth.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.PlainYearMonth"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.PlainYearMonth"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.calendar, calendar_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.year, year_getter, {}, Attribute::Configurable); @@ -55,8 +55,6 @@ ThrowCompletionOr PlainYearMonthPrototype::initialize(Realm& realm) define_native_function(realm, vm.names.valueOf, value_of, 0, attr); define_native_function(realm, vm.names.toPlainDate, to_plain_date, 1, attr); define_native_function(realm, vm.names.getISOFields, get_iso_fields, 0, attr); - - return {}; } // 9.3.3 get Temporal.PlainYearMonth.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plainyearmonth.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h index 33fbdbfb2f..3e987a077d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.h @@ -15,7 +15,7 @@ class PlainYearMonthPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~PlainYearMonthPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp index de9638758d..ddcdb1d58c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.cpp @@ -26,17 +26,17 @@ Temporal::Temporal(Realm& realm) { } -ThrowCompletionOr Temporal::initialize(Realm& realm) +void Temporal::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 1.1.1 Temporal [ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal"sv)), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_direct_property(vm.names.Now, MUST_OR_THROW_OOM(heap().allocate(realm, realm)), attr); + define_direct_property(vm.names.Now, MUST(heap().allocate(realm, realm)), attr); define_intrinsic_accessor(vm.names.Calendar, attr, [](auto& realm) -> Value { return realm.intrinsics().temporal_calendar_constructor(); }); define_intrinsic_accessor(vm.names.Duration, attr, [](auto& realm) -> Value { return realm.intrinsics().temporal_duration_constructor(); }); define_intrinsic_accessor(vm.names.Instant, attr, [](auto& realm) -> Value { return realm.intrinsics().temporal_instant_constructor(); }); @@ -47,8 +47,6 @@ ThrowCompletionOr Temporal::initialize(Realm& realm) define_intrinsic_accessor(vm.names.PlainYearMonth, attr, [](auto& realm) -> Value { return realm.intrinsics().temporal_plain_year_month_constructor(); }); define_intrinsic_accessor(vm.names.TimeZone, attr, [](auto& realm) -> Value { return realm.intrinsics().temporal_time_zone_constructor(); }); define_intrinsic_accessor(vm.names.ZonedDateTime, attr, [](auto& realm) -> Value { return realm.intrinsics().temporal_zoned_date_time_constructor(); }); - - return {}; } } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h index 57fcae6fd6..90c6a45251 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Temporal.h @@ -14,7 +14,7 @@ class Temporal final : public Object { JS_OBJECT(Temporal, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~Temporal() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp index 4e77f9706a..c5071d7ee0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp @@ -17,9 +17,9 @@ TimeZoneConstructor::TimeZoneConstructor(Realm& realm) { } -ThrowCompletionOr TimeZoneConstructor::initialize(Realm& realm) +void TimeZoneConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -30,8 +30,6 @@ ThrowCompletionOr TimeZoneConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.from, from, 1, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 11.2.1 Temporal.TimeZone ( identifier ), https://tc39.es/proposal-temporal/#sec-temporal.timezone diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h index 9c49f169fe..5de3ea1e26 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.h @@ -14,7 +14,7 @@ class TimeZoneConstructor final : public NativeFunction { JS_OBJECT(TimeZoneConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~TimeZoneConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp index 19bf3b1853..625912d99e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp @@ -23,9 +23,9 @@ TimeZonePrototype::TimeZonePrototype(Realm& realm) { } -ThrowCompletionOr TimeZonePrototype::initialize(Realm& realm) +void TimeZonePrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -42,9 +42,7 @@ ThrowCompletionOr TimeZonePrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toJSON, to_json, 0, attr); // 11.4.2 Temporal.TimeZone.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.timezone.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.TimeZone"sv)), Attribute::Configurable); - - return {}; + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.TimeZone"sv)), Attribute::Configurable); } // 11.4.3 get Temporal.TimeZone.prototype.id, https://tc39.es/proposal-temporal/#sec-get-temporal.timezone.prototype.id diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h index 3c3e362ca1..a1fb7f9103 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.h @@ -15,7 +15,7 @@ class TimeZonePrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~TimeZonePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp index 1b4a5808e0..551d97fb8e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.cpp @@ -21,9 +21,9 @@ ZonedDateTimeConstructor::ZonedDateTimeConstructor(Realm& realm) { } -ThrowCompletionOr ZonedDateTimeConstructor::initialize(Realm& realm) +void ZonedDateTimeConstructor::initialize(Realm& realm) { - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); @@ -35,8 +35,6 @@ ThrowCompletionOr ZonedDateTimeConstructor::initialize(Realm& realm) define_native_function(realm, vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); - - return {}; } // 6.1.1 Temporal.ZonedDateTime ( epochNanoseconds, timeZoneLike [ , calendarLike ] ), https://tc39.es/proposal-temporal/#sec-temporal.zoneddatetime diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h index 20445838ec..b1779d8206 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimeConstructor.h @@ -14,7 +14,7 @@ class ZonedDateTimeConstructor final : public NativeFunction { JS_OBJECT(ZonedDateTimeConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ZonedDateTimeConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index 6e6eb262b6..0f17cf40ee 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -26,14 +26,14 @@ ZonedDateTimePrototype::ZonedDateTimePrototype(Realm& realm) { } -ThrowCompletionOr ZonedDateTimePrototype::initialize(Realm& realm) +void ZonedDateTimePrototype::initialize(Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); auto& vm = this->vm(); // 6.3.2 Temporal.ZonedDateTime.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.zoneddatetime.prototype-@@tostringtag - define_direct_property(vm.well_known_symbol_to_string_tag(), MUST_OR_THROW_OOM(PrimitiveString::create(vm, "Temporal.ZonedDateTime"sv)), Attribute::Configurable); + define_direct_property(vm.well_known_symbol_to_string_tag(), MUST(PrimitiveString::create(vm, "Temporal.ZonedDateTime"sv)), Attribute::Configurable); define_native_accessor(realm, vm.names.calendar, calendar_getter, {}, Attribute::Configurable); define_native_accessor(realm, vm.names.timeZone, time_zone_getter, {}, Attribute::Configurable); @@ -90,8 +90,6 @@ ThrowCompletionOr ZonedDateTimePrototype::initialize(Realm& realm) define_native_function(realm, vm.names.toPlainYearMonth, to_plain_year_month, 0, attr); define_native_function(realm, vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); define_native_function(realm, vm.names.getISOFields, get_iso_fields, 0, attr); - - return {}; } // 6.3.3 get Temporal.ZonedDateTime.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.zoneddatetime.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h index 2fc873dc49..4e92877448 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.h @@ -15,7 +15,7 @@ class ZonedDateTimePrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~ZonedDateTimePrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp index 6ed2025ce9..c21d9022dd 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp @@ -466,13 +466,11 @@ void TypedArrayBase::visit_edges(Visitor& visitor) { \ } \ \ - ThrowCompletionOr PrototypeName::initialize(Realm& realm) \ + void PrototypeName::initialize(Realm& realm) \ { \ auto& vm = this->vm(); \ - MUST_OR_THROW_OOM(Base::initialize(realm)); \ + Base::initialize(realm); \ define_direct_property(vm.names.BYTES_PER_ELEMENT, Value((i32)sizeof(Type)), 0); \ - \ - return {}; \ } \ \ ConstructorName::ConstructorName(Realm& realm, Object& prototype) \ @@ -484,10 +482,10 @@ void TypedArrayBase::visit_edges(Visitor& visitor) { \ } \ \ - ThrowCompletionOr ConstructorName::initialize(Realm& realm) \ + void ConstructorName::initialize(Realm& realm) \ { \ auto& vm = this->vm(); \ - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); \ + Base::initialize(realm); \ \ /* 23.2.6.2 TypedArray.prototype, https://tc39.es/ecma262/#sec-typedarray.prototype */ \ define_direct_property(vm.names.prototype, realm.intrinsics().snake_name##_prototype(), 0); \ @@ -496,8 +494,6 @@ void TypedArrayBase::visit_edges(Visitor& visitor) define_direct_property(vm.names.BYTES_PER_ELEMENT, Value((i32)sizeof(Type)), 0); \ \ define_direct_property(vm.names.length, Value(3), Attribute::Configurable); \ - \ - return {}; \ } \ \ /* 23.2.5.1 TypedArray ( ...args ), https://tc39.es/ecma262/#sec-typedarray */ \ diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.h b/Userland/Libraries/LibJS/Runtime/TypedArray.h index 4a81ea75a7..885160568d 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.h @@ -479,7 +479,7 @@ ThrowCompletionOr compare_typed_array_elements(VM&, Value x, Value y, Fu JS_OBJECT(PrototypeName, Object); \ \ public: \ - virtual ThrowCompletionOr initialize(Realm&) override; \ + virtual void initialize(Realm&) override; \ virtual ~PrototypeName() override; \ \ private: \ @@ -489,7 +489,7 @@ ThrowCompletionOr compare_typed_array_elements(VM&, Value x, Value y, Fu JS_OBJECT(ConstructorName, TypedArrayConstructor); \ \ public: \ - virtual ThrowCompletionOr initialize(Realm&) override; \ + virtual void initialize(Realm&) override; \ virtual ~ConstructorName() override; \ \ virtual ThrowCompletionOr call() override; \ diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp index bfd178d463..c87e463d67 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp @@ -21,10 +21,10 @@ TypedArrayConstructor::TypedArrayConstructor(Realm& realm) { } -ThrowCompletionOr TypedArrayConstructor::initialize(Realm& realm) +void TypedArrayConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 23.2.2.3 %TypedArray%.prototype, https://tc39.es/ecma262/#sec-%typedarray%.prototype define_direct_property(vm.names.prototype, realm.intrinsics().typed_array_prototype(), 0); @@ -36,8 +36,6 @@ ThrowCompletionOr TypedArrayConstructor::initialize(Realm& realm) define_native_accessor(realm, vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 23.2.1.1 %TypedArray% ( ), https://tc39.es/ecma262/#sec-%typedarray% diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h index 9a9d3bf2fd..3d9ae5a08e 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.h @@ -15,7 +15,7 @@ class TypedArrayConstructor : public NativeFunction { public: explicit TypedArrayConstructor(Realm&); - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~TypedArrayConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index b0863292b2..f34d7576e6 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -21,10 +21,10 @@ TypedArrayPrototype::TypedArrayPrototype(Realm& realm) { } -ThrowCompletionOr TypedArrayPrototype::initialize(Realm& realm) +void TypedArrayPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_accessor(realm, vm.names.buffer, buffer_getter, nullptr, Attribute::Configurable); @@ -70,8 +70,6 @@ ThrowCompletionOr TypedArrayPrototype::initialize(Realm& realm) // 23.2.3.37 %TypedArray%.prototype [ @@iterator ] ( ), https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator define_direct_property(vm.well_known_symbol_iterator(), get_without_side_effects(vm.names.values), attr); - - return {}; } static ThrowCompletionOr typed_array_from_this(VM& vm) diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h index 3087a4343c..cb73efd9eb 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.h @@ -15,7 +15,7 @@ class TypedArrayPrototype final : public Object { JS_OBJECT(TypedArrayPrototype, Object); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~TypedArrayPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp index 9512ca8b31..26be688e06 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp @@ -18,17 +18,15 @@ WeakMapConstructor::WeakMapConstructor(Realm& realm) { } -ThrowCompletionOr WeakMapConstructor::initialize(Realm& realm) +void WeakMapConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 24.3.2.1 WeakMap.prototype, https://tc39.es/ecma262/#sec-weakmap.prototype define_direct_property(vm.names.prototype, realm.intrinsics().weak_map_prototype(), 0); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 24.3.1.1 WeakMap ( [ iterable ] ), https://tc39.es/ecma262/#sec-weakmap-iterable diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h index f090f628eb..57810ad481 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.h @@ -14,7 +14,7 @@ class WeakMapConstructor final : public NativeFunction { JS_OBJECT(WeakMapConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~WeakMapConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp index 4fd15ff076..cddc6fc2d9 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp @@ -16,10 +16,10 @@ WeakMapPrototype::WeakMapPrototype(Realm& realm) { } -ThrowCompletionOr WeakMapPrototype::initialize(Realm& realm) +void WeakMapPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.delete_, delete_, 1, attr); @@ -29,8 +29,6 @@ ThrowCompletionOr WeakMapPrototype::initialize(Realm& realm) // 24.3.3.6 WeakMap.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-weakmap.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.WeakMap.as_string()), Attribute::Configurable); - - return {}; } // 24.3.3.2 WeakMap.prototype.delete ( key ), https://tc39.es/ecma262/#sec-weakmap.prototype.delete diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h index edeb27b137..32aec28120 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.h @@ -15,7 +15,7 @@ class WeakMapPrototype final : public PrototypeObject JS_PROTOTYPE_OBJECT(WeakMapPrototype, WeakMap, WeakMap); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~WeakMapPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp index d6396ef5b6..81c87ae255 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp @@ -17,17 +17,15 @@ WeakRefConstructor::WeakRefConstructor(Realm& realm) { } -ThrowCompletionOr WeakRefConstructor::initialize(Realm& realm) +void WeakRefConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 26.1.2.1 WeakRef.prototype, https://tc39.es/ecma262/#sec-weak-ref.prototype define_direct_property(vm.names.prototype, realm.intrinsics().weak_ref_prototype(), 0); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); - - return {}; } // 26.1.1.1 WeakRef ( target ), https://tc39.es/ecma262/#sec-weak-ref-target diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h index 976c1d62af..a3afbf755f 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.h @@ -14,7 +14,7 @@ class WeakRefConstructor final : public NativeFunction { JS_OBJECT(WeakRefConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~WeakRefConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp index 28635e5b65..9c1d19f169 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp @@ -14,16 +14,14 @@ WeakRefPrototype::WeakRefPrototype(Realm& realm) { } -ThrowCompletionOr WeakRefPrototype::initialize(Realm& realm) +void WeakRefPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_function(realm, vm.names.deref, deref, 0, Attribute::Writable | Attribute::Configurable); define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.WeakRef.as_string()), Attribute::Configurable); - - return {}; } // 26.1.3.2 WeakRef.prototype.deref ( ), https://tc39.es/ecma262/#sec-weak-ref.prototype.deref diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h index ac72169745..3dbe323a7d 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h @@ -15,7 +15,7 @@ class WeakRefPrototype final : public PrototypeObject JS_PROTOTYPE_OBJECT(WeakRefPrototype, WeakRef, WeakRef); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~WeakRefPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp index d897db4dc2..d61d3816ad 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp @@ -18,17 +18,15 @@ WeakSetConstructor::WeakSetConstructor(Realm& realm) { } -ThrowCompletionOr WeakSetConstructor::initialize(Realm& realm) +void WeakSetConstructor::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); // 24.4.2.1 WeakSet.prototype, https://tc39.es/ecma262/#sec-weakset.prototype define_direct_property(vm.names.prototype, realm.intrinsics().weak_set_prototype(), 0); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); - - return {}; } // 24.4.1.1 WeakSet ( [ iterable ] ), https://tc39.es/ecma262/#sec-weakset-iterable diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h index b05db7ece7..7e423630d0 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.h @@ -14,7 +14,7 @@ class WeakSetConstructor final : public NativeFunction { JS_OBJECT(WeakSetConstructor, NativeFunction); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~WeakSetConstructor() override = default; virtual ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp index 7cb212b9d5..505d979de1 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp @@ -16,10 +16,10 @@ WeakSetPrototype::WeakSetPrototype(Realm& realm) { } -ThrowCompletionOr WeakSetPrototype::initialize(Realm& realm) +void WeakSetPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.add, add, 1, attr); @@ -28,8 +28,6 @@ ThrowCompletionOr WeakSetPrototype::initialize(Realm& realm) // 24.4.3.5 WeakSet.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-weakset.prototype-@@tostringtag define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.WeakSet.as_string()), Attribute::Configurable); - - return {}; } // 24.4.3.1 WeakSet.prototype.add ( value ), https://tc39.es/ecma262/#sec-weakset.prototype.add diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h index 720addeb27..2a01447bef 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.h @@ -15,7 +15,7 @@ class WeakSetPrototype final : public PrototypeObject JS_PROTOTYPE_OBJECT(WeakSetPrototype, WeakSet, WeakSet); public: - virtual ThrowCompletionOr initialize(Realm&) override; + virtual void initialize(Realm&) override; virtual ~WeakSetPrototype() override = default; private: diff --git a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp index 28beeae0e5..38f6ab866d 100644 --- a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.cpp @@ -16,16 +16,14 @@ WrapForValidIteratorPrototype::WrapForValidIteratorPrototype(Realm& realm) { } -ThrowCompletionOr WrapForValidIteratorPrototype::initialize(Realm& realm) +void WrapForValidIteratorPrototype::initialize(Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(realm, vm.names.next, next, 0, attr); define_native_function(realm, vm.names.return_, return_, 0, attr); - - return {}; } // 3.1.1.2.2.1.1 %WrapForValidIteratorPrototype%.next ( ), https://tc39.es/proposal-iterator-helpers/#sec-wrapforvaliditeratorprototype.next diff --git a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h index 5c3bcdeb07..c0693f07ce 100644 --- a/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WrapForValidIteratorPrototype.h @@ -16,7 +16,7 @@ class WrapForValidIteratorPrototype final : public PrototypeObject initialize(Realm&) override; + virtual void initialize(Realm&) override; private: explicit WrapForValidIteratorPrototype(Realm&); diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunner.h b/Userland/Libraries/LibTest/JavaScriptTestRunner.h index e8d8d01f3e..361d706e24 100644 --- a/Userland/Libraries/LibTest/JavaScriptTestRunner.h +++ b/Userland/Libraries/LibTest/JavaScriptTestRunner.h @@ -193,13 +193,13 @@ public: : JS::GlobalObject(realm) { } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~TestRunnerGlobalObject() override = default; }; -inline JS::ThrowCompletionOr TestRunnerGlobalObject::initialize(JS::Realm& realm) +inline void TestRunnerGlobalObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property("global", this, JS::Attribute::Enumerable); for (auto& entry : s_exposed_global_functions) { @@ -210,8 +210,6 @@ inline JS::ThrowCompletionOr TestRunnerGlobalObject::initialize(JS::Realm& }, entry.value.length, JS::default_attributes); } - - return {}; } inline ByteBuffer load_entire_file(StringView path) diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp index 23e41a83ba..dbc9629720 100644 --- a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp @@ -19,15 +19,13 @@ AudioConstructor::AudioConstructor(JS::Realm& realm) { } -JS::ThrowCompletionOr AudioConstructor::initialize(JS::Realm& realm) +void AudioConstructor::initialize(JS::Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); + Base::initialize(realm); define_direct_property(vm.names.prototype, &ensure_web_prototype(realm, "HTMLAudioElement"), 0); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); - - return {}; } JS::ThrowCompletionOr AudioConstructor::call() diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.h b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.h index 3f58eb5e54..85f464da7b 100644 --- a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.h +++ b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.h @@ -14,7 +14,7 @@ namespace Web::Bindings { class AudioConstructor final : public JS::NativeFunction { public: explicit AudioConstructor(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~AudioConstructor() override = default; virtual JS::ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp index c4429a00e7..54702eb923 100644 --- a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp @@ -19,15 +19,13 @@ ImageConstructor::ImageConstructor(JS::Realm& realm) { } -JS::ThrowCompletionOr ImageConstructor::initialize(JS::Realm& realm) +void ImageConstructor::initialize(JS::Realm& realm) { auto& vm = this->vm(); + Base::initialize(realm); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); define_direct_property(vm.names.prototype, &ensure_web_prototype(realm, "HTMLImageElement"), 0); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); - - return {}; } JS::ThrowCompletionOr ImageConstructor::call() diff --git a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.h b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.h index c38477d6c5..a5b5f058d9 100644 --- a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.h +++ b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.h @@ -14,7 +14,7 @@ namespace Web::Bindings { class ImageConstructor final : public JS::NativeFunction { public: explicit ImageConstructor(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~ImageConstructor() override = default; virtual JS::ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp index 4f775cf15b..9fd74eaa80 100644 --- a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp @@ -21,15 +21,13 @@ OptionConstructor::OptionConstructor(JS::Realm& realm) { } -JS::ThrowCompletionOr OptionConstructor::initialize(JS::Realm& realm) +void OptionConstructor::initialize(JS::Realm& realm) { auto& vm = this->vm(); + Base::initialize(realm); - MUST_OR_THROW_OOM(NativeFunction::initialize(realm)); define_direct_property(vm.names.prototype, &ensure_web_prototype(realm, "HTMLOptionElement"), 0); define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable); - - return {}; } JS::ThrowCompletionOr OptionConstructor::call() diff --git a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.h b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.h index bbb6b2fe11..a212ddb398 100644 --- a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.h +++ b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.h @@ -14,7 +14,7 @@ namespace Web::Bindings { class OptionConstructor final : public JS::NativeFunction { public: explicit OptionConstructor(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~OptionConstructor() override = default; virtual JS::ThrowCompletionOr call() override; diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp index 172a23e78c..5c641f4fcb 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp @@ -28,12 +28,10 @@ void CSSConditionRule::for_each_effective_keyframes_at_rule(Function CSSConditionRule::initialize(JS::Realm& realm) +void CSSConditionRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSConditionRule")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h index b705f47ac3..f2c16810e8 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.h @@ -28,7 +28,7 @@ public: protected: CSSConditionRule(JS::Realm&, CSSRuleList&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index 4b498f1135..3514169609 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp @@ -25,12 +25,10 @@ CSSFontFaceRule::CSSFontFaceRule(JS::Realm& realm, FontFace&& font_face) { } -JS::ThrowCompletionOr CSSFontFaceRule::initialize(JS::Realm& realm) +void CSSFontFaceRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSFontFaceRule")); - - return {}; } CSSStyleDeclaration* CSSFontFaceRule::style() diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h index ab6263bdfb..b467045efd 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h @@ -28,7 +28,7 @@ public: private: CSSFontFaceRule(JS::Realm&, FontFace&&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual DeprecatedString serialized() const override; FontFace m_font_face; diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp index b91aa011e0..4f6d4d5e7d 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp @@ -22,12 +22,10 @@ CSSGroupingRule::CSSGroupingRule(JS::Realm& realm, CSSRuleList& rules) rule->set_parent_rule(this); } -JS::ThrowCompletionOr CSSGroupingRule::initialize(JS::Realm& realm) +void CSSGroupingRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSGroupingRule")); - - return {}; } void CSSGroupingRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h index 826cae8ee2..f4c3eea68c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.h @@ -34,7 +34,7 @@ public: protected: CSSGroupingRule(JS::Realm&, CSSRuleList&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; private: diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp index bd7c2ade3c..6f24dbfbb1 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp @@ -40,12 +40,10 @@ CSSImportRule::CSSImportRule(AK::URL url, DOM::Document& document) set_resource(ResourceLoader::the().load_resource(Resource::Type::Generic, request)); } -JS::ThrowCompletionOr CSSImportRule::initialize(JS::Realm& realm) +void CSSImportRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSImportRule")); - - return {}; } void CSSImportRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h index e64917d5e9..c11b07a21a 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h @@ -40,7 +40,7 @@ public: private: CSSImportRule(AK::URL, DOM::Document&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual DeprecatedString serialized() const override; diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp index 7c70628e9c..3724d46ccc 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp @@ -22,11 +22,10 @@ void CSSKeyframeRule::visit_edges(Visitor& visitor) visitor.visit(m_declarations); } -JS::ThrowCompletionOr CSSKeyframeRule::initialize(JS::Realm& realm) +void CSSKeyframeRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSKeyframeRule")); - return {}; } DeprecatedString CSSKeyframeRule::serialized() const diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h index cfaf017482..ba49322c76 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.h @@ -48,7 +48,7 @@ private: } virtual void visit_edges(Visitor&) override; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual DeprecatedString serialized() const override; CSS::Percentage m_key; diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp index 8494597499..a9e7bf25e2 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp @@ -22,12 +22,10 @@ void CSSKeyframesRule::visit_edges(Visitor& visitor) visitor.visit(keyframe); } -JS::ThrowCompletionOr CSSKeyframesRule::initialize(JS::Realm& realm) +void CSSKeyframesRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSKeyframesRule")); - - return {}; } DeprecatedString CSSKeyframesRule::serialized() const diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.h b/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.h index 2038e5fe4e..ab074f1b7a 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.h @@ -46,7 +46,7 @@ private: virtual void visit_edges(Visitor&) override; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual DeprecatedString serialized() const override; FlyString m_name; diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp index b92e8ae33a..83720bfecc 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp @@ -23,12 +23,10 @@ CSSMediaRule::CSSMediaRule(JS::Realm& realm, MediaList& media, CSSRuleList& rule { } -JS::ThrowCompletionOr CSSMediaRule::initialize(JS::Realm& realm) +void CSSMediaRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSMediaRule")); - - return {}; } void CSSMediaRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h index e6bf41631d..492ecc8ace 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h @@ -35,7 +35,7 @@ public: private: CSSMediaRule(JS::Realm&, MediaList&, CSSRuleList&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual DeprecatedString serialized() const override; diff --git a/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp index b3f8e3f81a..17d8061dfc 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp @@ -25,12 +25,10 @@ WebIDL::ExceptionOr> CSSNamespaceRule::create return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, prefix, namespace_uri)); } -JS::ThrowCompletionOr CSSNamespaceRule::initialize(JS::Realm& realm) +void CSSNamespaceRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSNamespaceRule")); - - return {}; } // https://www.w3.org/TR/cssom/#serialize-a-css-rule diff --git a/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.h b/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.h index 4d77a2517e..b115114a5d 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.h @@ -27,7 +27,7 @@ public: private: CSSNamespaceRule(JS::Realm&, Optional prefix, StringView namespace_uri); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual DeprecatedString serialized() const override; DeprecatedString m_namespace_uri; diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp index 49a4cfe8ad..c9172a04bc 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp @@ -36,12 +36,10 @@ WebIDL::ExceptionOr> CSSRuleList::create_empty(JS: return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm)); } -JS::ThrowCompletionOr CSSRuleList::initialize(JS::Realm& realm) +void CSSRuleList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSRuleList")); - - return {}; } void CSSRuleList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.h b/Userland/Libraries/LibWeb/CSS/CSSRuleList.h index 395c439e20..1fcbf9cf6f 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.h +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.h @@ -66,7 +66,7 @@ public: private: explicit CSSRuleList(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^Bindings::LegacyPlatformObject diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index de19d3554d..bbd7f8686b 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -20,11 +20,10 @@ CSSStyleDeclaration::CSSStyleDeclaration(JS::Realm& realm) { } -JS::ThrowCompletionOr CSSStyleDeclaration::initialize(JS::Realm& realm) +void CSSStyleDeclaration::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSStyleDeclaration")); - return {}; } WebIDL::ExceptionOr> PropertyOwningCSSStyleDeclaration::create(JS::Realm& realm, Vector properties, HashMap custom_properties) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h index 62cabc1a4d..9450304f81 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h @@ -19,7 +19,7 @@ class CSSStyleDeclaration : public Bindings::PlatformObject { public: virtual ~CSSStyleDeclaration() = default; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual size_t length() const = 0; virtual DeprecatedString item(size_t index) const = 0; diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp index eac05cf0df..a8024525c5 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp @@ -24,12 +24,10 @@ CSSStyleRule::CSSStyleRule(JS::Realm& realm, Vector>&& s { } -JS::ThrowCompletionOr CSSStyleRule::initialize(JS::Realm& realm) +void CSSStyleRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSStyleRule")); - - return {}; } void CSSStyleRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h index 360883d015..4450999492 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h @@ -35,7 +35,7 @@ public: private: CSSStyleRule(JS::Realm&, Vector>&&, CSSStyleDeclaration&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual DeprecatedString serialized() const override; diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp index 8c12f90461..9e2012f18a 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp @@ -37,12 +37,10 @@ CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& me }; } -JS::ThrowCompletionOr CSSStyleSheet::initialize(JS::Realm& realm) +void CSSStyleSheet::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSStyleSheet")); - - return {}; } void CSSStyleSheet::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h index cffc45f0b8..2f14dc17ac 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h @@ -54,7 +54,7 @@ public: private: CSSStyleSheet(JS::Realm&, CSSRuleList&, MediaList&, Optional location); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; void recalculate_namespaces(); diff --git a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp index ff1b50a759..ff32ead910 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp @@ -22,12 +22,10 @@ CSSSupportsRule::CSSSupportsRule(JS::Realm& realm, NonnullRefPtr&& sup { } -JS::ThrowCompletionOr CSSSupportsRule::initialize(JS::Realm& realm) +void CSSSupportsRule::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CSSSupportsRule")); - - return {}; } DeprecatedString CSSSupportsRule::condition_text() const diff --git a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h index ec3f8913b1..23f033409a 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.h @@ -32,7 +32,7 @@ public: private: CSSSupportsRule(JS::Realm&, NonnullRefPtr&&, CSSRuleList&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual DeprecatedString serialized() const override; NonnullRefPtr m_supports; diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.cpp b/Userland/Libraries/LibWeb/CSS/MediaList.cpp index 038e8f4df3..26146d7df3 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaList.cpp @@ -24,12 +24,10 @@ MediaList::MediaList(JS::Realm& realm, Vector>&& media { } -JS::ThrowCompletionOr MediaList::initialize(JS::Realm& realm) +void MediaList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MediaList")); - - return {}; } // https://www.w3.org/TR/cssom-1/#dom-medialist-mediatext diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.h b/Userland/Libraries/LibWeb/CSS/MediaList.h index d4b8bcf451..50788a58bf 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.h +++ b/Userland/Libraries/LibWeb/CSS/MediaList.h @@ -39,7 +39,7 @@ public: private: MediaList(JS::Realm&, Vector>&&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^Bindings::LegacyPlatformObject virtual bool supports_indexed_properties() const override { return true; } diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp index eaa1c51281..309e39f929 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp @@ -28,12 +28,10 @@ MediaQueryList::MediaQueryList(DOM::Document& document, Vector MediaQueryList::initialize(JS::Realm& realm) +void MediaQueryList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MediaQueryList")); - - return {}; } void MediaQueryList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryList.h b/Userland/Libraries/LibWeb/CSS/MediaQueryList.h index 276c84c14f..40f281028f 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryList.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryList.h @@ -34,7 +34,7 @@ public: private: MediaQueryList(DOM::Document&, Vector>&&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_document; diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp index 875358c71f..bdadffae1c 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp @@ -24,12 +24,10 @@ MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, FlyString const& even MediaQueryListEvent::~MediaQueryListEvent() = default; -JS::ThrowCompletionOr MediaQueryListEvent::initialize(JS::Realm& realm) +void MediaQueryListEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MediaQueryListEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h index 18f1696935..8e4310bf46 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.h @@ -30,7 +30,7 @@ public: private: MediaQueryListEvent(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; String m_media; bool m_matches; diff --git a/Userland/Libraries/LibWeb/CSS/Screen.cpp b/Userland/Libraries/LibWeb/CSS/Screen.cpp index af75909b4b..087244286f 100644 --- a/Userland/Libraries/LibWeb/CSS/Screen.cpp +++ b/Userland/Libraries/LibWeb/CSS/Screen.cpp @@ -24,12 +24,10 @@ Screen::Screen(HTML::Window& window) { } -JS::ThrowCompletionOr Screen::initialize(JS::Realm& realm) +void Screen::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Screen")); - - return {}; } void Screen::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/Screen.h b/Userland/Libraries/LibWeb/CSS/Screen.h index 981a387aa7..9f8ec1d165 100644 --- a/Userland/Libraries/LibWeb/CSS/Screen.h +++ b/Userland/Libraries/LibWeb/CSS/Screen.h @@ -29,7 +29,7 @@ public: private: explicit Screen(HTML::Window&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; HTML::Window const& window() const { return *m_window; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp index 584b667de8..2d2805ad31 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp @@ -74,12 +74,10 @@ StyleSheetList::StyleSheetList(DOM::Document& document) { } -JS::ThrowCompletionOr StyleSheetList::initialize(JS::Realm& realm) +void StyleSheetList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "StyleSheetList")); - - return {}; } void StyleSheetList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheetList.h b/Userland/Libraries/LibWeb/CSS/StyleSheetList.h index 71ce02f92c..455ad6ed58 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleSheetList.h +++ b/Userland/Libraries/LibWeb/CSS/StyleSheetList.h @@ -42,7 +42,7 @@ public: private: explicit StyleSheetList(DOM::Document&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^Bindings::LegacyPlatformObject diff --git a/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp b/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp index bd4f9ba066..92cb7d0422 100644 --- a/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp +++ b/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp @@ -26,12 +26,10 @@ VisualViewport::VisualViewport(DOM::Document& document) { } -JS::ThrowCompletionOr VisualViewport::initialize(JS::Realm& realm) +void VisualViewport::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "VisualViewport")); - - return {}; } void VisualViewport::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/VisualViewport.h b/Userland/Libraries/LibWeb/CSS/VisualViewport.h index 56e4137382..19d1453900 100644 --- a/Userland/Libraries/LibWeb/CSS/VisualViewport.h +++ b/Userland/Libraries/LibWeb/CSS/VisualViewport.h @@ -40,7 +40,7 @@ public: private: explicit VisualViewport(DOM::Document&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_document; diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp index 2ac892f6bd..1666df5535 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp @@ -27,15 +27,11 @@ Crypto::Crypto(JS::Realm& realm) Crypto::~Crypto() = default; -JS::ThrowCompletionOr Crypto::initialize(JS::Realm& realm) +void Crypto::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Crypto")); - m_subtle = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() { - return SubtleCrypto::create(realm); - })); - - return {}; + m_subtle = MUST(SubtleCrypto::create(realm)); } JS::NonnullGCPtr Crypto::subtle() const diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.h b/Userland/Libraries/LibWeb/Crypto/Crypto.h index c59b2b6907..74d3c002fc 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.h +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.h @@ -26,7 +26,7 @@ public: WebIDL::ExceptionOr random_uuid() const; protected: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; private: diff --git a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp index f540c2e5f8..a419e4f16b 100644 --- a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp @@ -26,12 +26,10 @@ SubtleCrypto::SubtleCrypto(JS::Realm& realm) SubtleCrypto::~SubtleCrypto() = default; -JS::ThrowCompletionOr SubtleCrypto::initialize(JS::Realm& realm) +void SubtleCrypto::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SubtleCrypto")); - - return {}; } // https://w3c.github.io/webcrypto/#dfn-SubtleCrypto-method-digest diff --git a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h index ad4c700d75..4f95682396 100644 --- a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h +++ b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h @@ -23,7 +23,7 @@ public: private: explicit SubtleCrypto(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/DOM/AbortController.cpp b/Userland/Libraries/LibWeb/DOM/AbortController.cpp index 63d4d47c47..3c99d8e5ff 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortController.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbortController.cpp @@ -25,12 +25,10 @@ AbortController::AbortController(JS::Realm& realm, JS::NonnullGCPtr AbortController::~AbortController() = default; -JS::ThrowCompletionOr AbortController::initialize(JS::Realm& realm) +void AbortController::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "AbortController")); - - return {}; } void AbortController::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/AbortController.h b/Userland/Libraries/LibWeb/DOM/AbortController.h index 0176fa1d7b..9f1944fe43 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortController.h +++ b/Userland/Libraries/LibWeb/DOM/AbortController.h @@ -28,7 +28,7 @@ public: private: AbortController(JS::Realm&, JS::NonnullGCPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // https://dom.spec.whatwg.org/#abortcontroller-signal diff --git a/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp b/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp index d8a20f599a..3664198f55 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp @@ -22,12 +22,10 @@ AbortSignal::AbortSignal(JS::Realm& realm) { } -JS::ThrowCompletionOr AbortSignal::initialize(JS::Realm& realm) +void AbortSignal::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "AbortSignal")); - - return {}; } // https://dom.spec.whatwg.org/#abortsignal-add diff --git a/Userland/Libraries/LibWeb/DOM/AbortSignal.h b/Userland/Libraries/LibWeb/DOM/AbortSignal.h index e0a6d7af55..477971e1a5 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortSignal.h +++ b/Userland/Libraries/LibWeb/DOM/AbortSignal.h @@ -43,7 +43,7 @@ public: private: explicit AbortSignal(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; // https://dom.spec.whatwg.org/#abortsignal-abort-reason diff --git a/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp b/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp index f4f6632269..8c22be6b1a 100644 --- a/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp @@ -21,12 +21,10 @@ AbstractRange::AbstractRange(Node& start_container, u32 start_offset, Node& end_ AbstractRange::~AbstractRange() = default; -JS::ThrowCompletionOr AbstractRange::initialize(JS::Realm& realm) +void AbstractRange::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "AbstractRange")); - - return {}; } void AbstractRange::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/AbstractRange.h b/Userland/Libraries/LibWeb/DOM/AbstractRange.h index 2490a39ac8..af8b04bad3 100644 --- a/Userland/Libraries/LibWeb/DOM/AbstractRange.h +++ b/Userland/Libraries/LibWeb/DOM/AbstractRange.h @@ -36,7 +36,7 @@ public: protected: AbstractRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_start_container; diff --git a/Userland/Libraries/LibWeb/DOM/Attr.cpp b/Userland/Libraries/LibWeb/DOM/Attr.cpp index 50a9f35649..a0148bb65d 100644 --- a/Userland/Libraries/LibWeb/DOM/Attr.cpp +++ b/Userland/Libraries/LibWeb/DOM/Attr.cpp @@ -38,12 +38,10 @@ Attr::Attr(Document& document, QualifiedName qualified_name, DeprecatedString va { } -JS::ThrowCompletionOr Attr::initialize(JS::Realm& realm) +void Attr::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Attr")); - - return {}; } void Attr::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Attr.h b/Userland/Libraries/LibWeb/DOM/Attr.h index cacf2b755f..5ba24c6095 100644 --- a/Userland/Libraries/LibWeb/DOM/Attr.h +++ b/Userland/Libraries/LibWeb/DOM/Attr.h @@ -46,7 +46,7 @@ public: private: Attr(Document&, QualifiedName, DeprecatedString value, Element*); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; QualifiedName m_qualified_name; diff --git a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp index 6ced5bd51e..d738f2fd4e 100644 --- a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp +++ b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp @@ -16,12 +16,10 @@ CDATASection::CDATASection(Document& document, DeprecatedString const& data) CDATASection::~CDATASection() = default; -JS::ThrowCompletionOr CDATASection::initialize(JS::Realm& realm) +void CDATASection::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CDATASection")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/DOM/CDATASection.h b/Userland/Libraries/LibWeb/DOM/CDATASection.h index e56aeac0f6..148dad1c8d 100644 --- a/Userland/Libraries/LibWeb/DOM/CDATASection.h +++ b/Userland/Libraries/LibWeb/DOM/CDATASection.h @@ -23,7 +23,7 @@ public: private: CDATASection(Document&, DeprecatedString const&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; template<> diff --git a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp index 7ac5a43e2d..3b123b85dc 100644 --- a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp +++ b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp @@ -19,12 +19,10 @@ CharacterData::CharacterData(Document& document, NodeType type, DeprecatedString { } -JS::ThrowCompletionOr CharacterData::initialize(JS::Realm& realm) +void CharacterData::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CharacterData")); - - return {}; } // https://dom.spec.whatwg.org/#dom-characterdata-data diff --git a/Userland/Libraries/LibWeb/DOM/CharacterData.h b/Userland/Libraries/LibWeb/DOM/CharacterData.h index 6b1b992d77..328a14a0db 100644 --- a/Userland/Libraries/LibWeb/DOM/CharacterData.h +++ b/Userland/Libraries/LibWeb/DOM/CharacterData.h @@ -36,7 +36,7 @@ public: protected: CharacterData(Document&, NodeType, DeprecatedString const&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: DeprecatedString m_data; diff --git a/Userland/Libraries/LibWeb/DOM/Comment.cpp b/Userland/Libraries/LibWeb/DOM/Comment.cpp index 1a8794837c..ebf250cd9e 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.cpp +++ b/Userland/Libraries/LibWeb/DOM/Comment.cpp @@ -23,12 +23,10 @@ WebIDL::ExceptionOr> Comment::construct_impl(JS::Realm return MUST_OR_THROW_OOM(realm.heap().allocate(realm, window.associated_document(), data)); } -JS::ThrowCompletionOr Comment::initialize(JS::Realm& realm) +void Comment::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Comment")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/DOM/Comment.h b/Userland/Libraries/LibWeb/DOM/Comment.h index b0fe1d482e..cc2dd74370 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.h +++ b/Userland/Libraries/LibWeb/DOM/Comment.h @@ -23,7 +23,7 @@ public: private: Comment(Document&, DeprecatedString const&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; template<> diff --git a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp index 154359d6c9..6684dc164c 100644 --- a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp +++ b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp @@ -29,12 +29,10 @@ CustomEvent::CustomEvent(JS::Realm& realm, FlyString const& event_name, CustomEv CustomEvent::~CustomEvent() = default; -JS::ThrowCompletionOr CustomEvent::initialize(JS::Realm& realm) +void CustomEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CustomEvent")); - - return {}; } void CustomEvent::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/CustomEvent.h b/Userland/Libraries/LibWeb/DOM/CustomEvent.h index f4165ab321..3fd62c5f55 100644 --- a/Userland/Libraries/LibWeb/DOM/CustomEvent.h +++ b/Userland/Libraries/LibWeb/DOM/CustomEvent.h @@ -29,7 +29,7 @@ public: // https://dom.spec.whatwg.org/#dom-customevent-detail JS::Value detail() const { return m_detail; } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; void init_custom_event(String const& type, bool bubbles, bool cancelable, JS::Value detail); diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index 445549ded9..1fb91d5d5a 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -31,12 +31,10 @@ DOMImplementation::DOMImplementation(Document& document) DOMImplementation::~DOMImplementation() = default; -JS::ThrowCompletionOr DOMImplementation::initialize(JS::Realm& realm) +void DOMImplementation::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMImplementation")); - - return {}; } void DOMImplementation::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.h b/Userland/Libraries/LibWeb/DOM/DOMImplementation.h index db41ac8ea7..2f56d89cdb 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.h +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.h @@ -30,7 +30,7 @@ public: private: explicit DOMImplementation(Document&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; Document& document() { return m_document; } diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp index ab85a1cf59..8dc2ae9fe4 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -68,12 +68,10 @@ DOMTokenList::DOMTokenList(Element& associated_element, DeprecatedFlyString asso associated_attribute_changed(value); } -JS::ThrowCompletionOr DOMTokenList::initialize(JS::Realm& realm) +void DOMTokenList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMTokenList")); - - return {}; } void DOMTokenList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.h b/Userland/Libraries/LibWeb/DOM/DOMTokenList.h index 84d859d80f..798e266d50 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.h +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.h @@ -46,7 +46,7 @@ public: private: DOMTokenList(Element& associated_element, DeprecatedFlyString associated_attribute); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^Bindings::LegacyPlatformObject diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 4b97ed5fc6..bdf1c7ad5c 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -336,16 +336,14 @@ Document::~Document() HTML::main_thread_event_loop().unregister_document({}, *this); } -JS::ThrowCompletionOr Document::initialize(JS::Realm& realm) +void Document::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Document")); - m_selection = MUST_OR_THROW_OOM(heap().allocate(realm, realm, *this)); + m_selection = MUST(heap().allocate(realm, realm, *this)); - m_list_of_available_images = TRY_OR_THROW_OOM(realm.vm(), try_make()); - - return {}; + m_list_of_available_images = make(); } void Document::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index c7a3d826bf..6e40c04f54 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -500,7 +500,7 @@ public: void shared_declarative_refresh_steps(StringView input, JS::GCPtr meta_element = nullptr); protected: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; Document(JS::Realm&, AK::URL const&); diff --git a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp index ed4c0169ff..c9db334904 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp @@ -14,12 +14,10 @@ DocumentFragment::DocumentFragment(Document& document) { } -JS::ThrowCompletionOr DocumentFragment::initialize(JS::Realm& realm) +void DocumentFragment::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DocumentFragment")); - - return {}; } void DocumentFragment::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/DocumentFragment.h b/Userland/Libraries/LibWeb/DOM/DocumentFragment.h index 2fb4f1446f..f34aa27819 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentFragment.h +++ b/Userland/Libraries/LibWeb/DOM/DocumentFragment.h @@ -33,7 +33,7 @@ public: protected: explicit DocumentFragment(Document& document); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; private: diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.cpp b/Userland/Libraries/LibWeb/DOM/DocumentType.cpp index b707deba03..4127bc5474 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentType.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentType.cpp @@ -19,12 +19,10 @@ DocumentType::DocumentType(Document& document) { } -JS::ThrowCompletionOr DocumentType::initialize(JS::Realm& realm) +void DocumentType::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DocumentType")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.h b/Userland/Libraries/LibWeb/DOM/DocumentType.h index 6808c42d3f..32c7afa287 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentType.h +++ b/Userland/Libraries/LibWeb/DOM/DocumentType.h @@ -36,7 +36,7 @@ public: private: explicit DocumentType(Document&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; DeprecatedString m_name; DeprecatedString m_public_id; diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index e54a2dc133..8c7df7b8e7 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -70,16 +70,12 @@ Element::Element(Document& document, DOM::QualifiedName qualified_name) Element::~Element() = default; -JS::ThrowCompletionOr Element::initialize(JS::Realm& realm) +void Element::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Element")); - m_attributes = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() { - return NamedNodeMap::create(*this); - })); - - return {}; + m_attributes = MUST(NamedNodeMap::create(*this)); } void Element::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 3ba4f6d05e..1bc6bf2d31 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -324,7 +324,7 @@ public: protected: Element(Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void children_changed() override; virtual i32 default_tab_index_value() const; diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp index 8d7809ff1b..9031e06e67 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.cpp +++ b/Userland/Libraries/LibWeb/DOM/Event.cpp @@ -41,12 +41,10 @@ Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_ini { } -JS::ThrowCompletionOr Event::initialize(JS::Realm& realm) +void Event::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Event")); - - return {}; } void Event::visit_edges(Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Event.h b/Userland/Libraries/LibWeb/DOM/Event.h index aae9d1116c..53a158be2b 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.h +++ b/Userland/Libraries/LibWeb/DOM/Event.h @@ -146,7 +146,7 @@ public: protected: void initialize_event(String const&, bool, bool); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Visitor&) override; private: diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp index c7adb76953..a015e69d04 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp @@ -52,16 +52,14 @@ WebIDL::ExceptionOr> EventTarget::construct_impl(J return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm)); } -JS::ThrowCompletionOr EventTarget::initialize(JS::Realm& realm) +void EventTarget::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); // FIXME: We can't do this for HTML::Window currently, as this will run when creating the initial global object. // During this time, the ESO is not setup, so it will cause a nullptr dereference in host_defined_intrinsics. if (!is(this)) set_prototype(&Bindings::ensure_web_prototype(realm, "EventTarget")); - - return {}; } void EventTarget::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.h b/Userland/Libraries/LibWeb/DOM/EventTarget.h index e380f6f321..cfc5f729ca 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.h +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.h @@ -64,7 +64,7 @@ protected: void element_event_handler_attribute_changed(FlyString const& local_name, Optional const& value); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; private: diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp index efa9a5855f..e76fca5c68 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -28,12 +28,10 @@ HTMLCollection::HTMLCollection(ParentNode& root, Scope scope, Function HTMLCollection::initialize(JS::Realm& realm) +void HTMLCollection::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLCollection")); - - return {}; } void HTMLCollection::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.h b/Userland/Libraries/LibWeb/DOM/HTMLCollection.h index 252ef75fe5..3383980d7e 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.h +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.h @@ -52,7 +52,7 @@ public: protected: HTMLCollection(ParentNode& root, Scope, Function filter); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; JS::NonnullGCPtr root() { return *m_root; } diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp index 9ea46c18be..9b877ff206 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp @@ -31,12 +31,10 @@ MutationObserver::MutationObserver(JS::Realm& realm, JS::GCPtr MutationObserver::initialize(JS::Realm& realm) +void MutationObserver::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MutationObserver")); - - return {}; } void MutationObserver::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.h b/Userland/Libraries/LibWeb/DOM/MutationObserver.h index 75c03289d3..d2ce3f5c8f 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.h +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.h @@ -51,7 +51,7 @@ public: private: MutationObserver(JS::Realm&, JS::GCPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // https://dom.spec.whatwg.org/#concept-mo-callback diff --git a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp index 4474115470..cd74d8e2a1 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp @@ -33,12 +33,10 @@ MutationRecord::MutationRecord(JS::Realm& realm, FlyString const& type, Node con MutationRecord::~MutationRecord() = default; -JS::ThrowCompletionOr MutationRecord::initialize(JS::Realm& realm) +void MutationRecord::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MutationRecord")); - - return {}; } void MutationRecord::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/MutationRecord.h b/Userland/Libraries/LibWeb/DOM/MutationRecord.h index 273ce80602..bb2f16d94f 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationRecord.h +++ b/Userland/Libraries/LibWeb/DOM/MutationRecord.h @@ -33,7 +33,7 @@ public: private: MutationRecord(JS::Realm& realm, FlyString const& type, Node const& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; FlyString m_type; diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp index 9219add054..044e72150f 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp @@ -25,12 +25,10 @@ NamedNodeMap::NamedNodeMap(Element& element) { } -JS::ThrowCompletionOr NamedNodeMap::initialize(JS::Realm& realm) +void NamedNodeMap::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "NamedNodeMap")); - - return {}; } void NamedNodeMap::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h index 9c6cbe7356..09d283c0eb 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.h @@ -56,7 +56,7 @@ public: private: explicit NamedNodeMap(Element&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^Bindings::LegacyPlatformObject diff --git a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp index 64b2adccc7..bb9caf2cb9 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp @@ -21,12 +21,10 @@ NodeIterator::NodeIterator(Node& root) NodeIterator::~NodeIterator() = default; -JS::ThrowCompletionOr NodeIterator::initialize(JS::Realm& realm) +void NodeIterator::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "NodeIterator")); - - return {}; } void NodeIterator::finalize() diff --git a/Userland/Libraries/LibWeb/DOM/NodeIterator.h b/Userland/Libraries/LibWeb/DOM/NodeIterator.h index 77815e32c6..d1c484a714 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeIterator.h +++ b/Userland/Libraries/LibWeb/DOM/NodeIterator.h @@ -37,7 +37,7 @@ public: private: explicit NodeIterator(Node& root); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void finalize() override; diff --git a/Userland/Libraries/LibWeb/DOM/NodeList.cpp b/Userland/Libraries/LibWeb/DOM/NodeList.cpp index a98fefc6e7..b78851125a 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeList.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeList.cpp @@ -17,12 +17,10 @@ NodeList::NodeList(JS::Realm& realm) NodeList::~NodeList() = default; -JS::ThrowCompletionOr NodeList::initialize(JS::Realm& realm) +void NodeList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "NodeList")); - - return {}; } WebIDL::ExceptionOr NodeList::item_value(size_t index) const diff --git a/Userland/Libraries/LibWeb/DOM/NodeList.h b/Userland/Libraries/LibWeb/DOM/NodeList.h index 8e16d25287..0e3011907e 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeList.h +++ b/Userland/Libraries/LibWeb/DOM/NodeList.h @@ -27,7 +27,7 @@ public: protected: explicit NodeList(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^Bindings::LegacyPlatformObject virtual bool supports_indexed_properties() const final override { return true; } diff --git a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp index 52796dbd2b..791d8eede7 100644 --- a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp +++ b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp @@ -17,12 +17,10 @@ ProcessingInstruction::ProcessingInstruction(Document& document, DeprecatedStrin { } -JS::ThrowCompletionOr ProcessingInstruction::initialize(JS::Realm& realm) +void ProcessingInstruction::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ProcessingInstruction")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h index e4321ad65c..ad5e448468 100644 --- a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h +++ b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.h @@ -24,7 +24,7 @@ public: private: ProcessingInstruction(Document&, DeprecatedString const& data, DeprecatedString const& target); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; DeprecatedString m_target; }; diff --git a/Userland/Libraries/LibWeb/DOM/Range.cpp b/Userland/Libraries/LibWeb/DOM/Range.cpp index 6627a92a1b..dd0dc115d5 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.cpp +++ b/Userland/Libraries/LibWeb/DOM/Range.cpp @@ -70,12 +70,10 @@ Range::~Range() live_ranges().remove(this); } -JS::ThrowCompletionOr Range::initialize(JS::Realm& realm) +void Range::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Range")); - - return {}; } void Range::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Range.h b/Userland/Libraries/LibWeb/DOM/Range.h index a6e2490edd..1a24e922b5 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.h +++ b/Userland/Libraries/LibWeb/DOM/Range.h @@ -95,7 +95,7 @@ private: explicit Range(Document&); Range(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; Node& root(); diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp index 50703e14b9..cb665951ef 100644 --- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp +++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp @@ -19,11 +19,10 @@ ShadowRoot::ShadowRoot(Document& document, Element& host, Bindings::ShadowRootMo set_host(&host); } -JS::ThrowCompletionOr ShadowRoot::initialize(JS::Realm& realm) +void ShadowRoot::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ShadowRoot")); - return {}; } // https://dom.spec.whatwg.org/#ref-for-get-the-parent%E2%91%A6 diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h index db9a24ba61..6a00aa27f9 100644 --- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h +++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h @@ -31,7 +31,7 @@ public: private: ShadowRoot(Document&, Element& host, Bindings::ShadowRootMode); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^Node virtual DeprecatedFlyString node_name() const override { return "#shadow-root"; } diff --git a/Userland/Libraries/LibWeb/DOM/StaticRange.cpp b/Userland/Libraries/LibWeb/DOM/StaticRange.cpp index b2733fb629..1aec3b2081 100644 --- a/Userland/Libraries/LibWeb/DOM/StaticRange.cpp +++ b/Userland/Libraries/LibWeb/DOM/StaticRange.cpp @@ -35,12 +35,10 @@ WebIDL::ExceptionOr> StaticRange::construct_impl(J return MUST_OR_THROW_OOM(realm.heap().allocate(realm, *init.start_container, init.start_offset, *init.end_container, init.end_offset)); } -JS::ThrowCompletionOr StaticRange::initialize(JS::Realm& realm) +void StaticRange::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "StaticRange")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/DOM/StaticRange.h b/Userland/Libraries/LibWeb/DOM/StaticRange.h index 3f306be75b..8ec05fbb5d 100644 --- a/Userland/Libraries/LibWeb/DOM/StaticRange.h +++ b/Userland/Libraries/LibWeb/DOM/StaticRange.h @@ -29,7 +29,7 @@ public: StaticRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset); virtual ~StaticRange() override; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/DOM/Text.cpp b/Userland/Libraries/LibWeb/DOM/Text.cpp index b63442d039..ef0280352f 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.cpp +++ b/Userland/Libraries/LibWeb/DOM/Text.cpp @@ -24,12 +24,10 @@ Text::Text(Document& document, NodeType type, DeprecatedString const& data) { } -JS::ThrowCompletionOr Text::initialize(JS::Realm& realm) +void Text::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Text")); - - return {}; } void Text::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Text.h b/Userland/Libraries/LibWeb/DOM/Text.h index 8bb3326a14..2bf65a05be 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.h +++ b/Userland/Libraries/LibWeb/DOM/Text.h @@ -38,7 +38,7 @@ protected: Text(Document&, DeprecatedString const&); Text(Document&, NodeType, DeprecatedString const&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; private: diff --git a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp index a163bac8c0..fec61ba5ff 100644 --- a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp +++ b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp @@ -22,12 +22,10 @@ TreeWalker::TreeWalker(Node& root) TreeWalker::~TreeWalker() = default; -JS::ThrowCompletionOr TreeWalker::initialize(JS::Realm& realm) +void TreeWalker::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TreeWalker")); - - return {}; } void TreeWalker::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/TreeWalker.h b/Userland/Libraries/LibWeb/DOM/TreeWalker.h index b2dbff68d1..65c3e7ee0e 100644 --- a/Userland/Libraries/LibWeb/DOM/TreeWalker.h +++ b/Userland/Libraries/LibWeb/DOM/TreeWalker.h @@ -39,7 +39,7 @@ public: private: explicit TreeWalker(Node& root); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; enum class ChildTraversalType { diff --git a/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp b/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp index ba0a0d1676..8655b8ac5f 100644 --- a/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp +++ b/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp @@ -14,12 +14,10 @@ XMLDocument::XMLDocument(JS::Realm& realm, AK::URL const& url) { } -JS::ThrowCompletionOr XMLDocument::initialize(JS::Realm& realm) +void XMLDocument::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "XMLDocument")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/DOM/XMLDocument.h b/Userland/Libraries/LibWeb/DOM/XMLDocument.h index b588c83a7a..6a1fb3f8cd 100644 --- a/Userland/Libraries/LibWeb/DOM/XMLDocument.h +++ b/Userland/Libraries/LibWeb/DOM/XMLDocument.h @@ -19,7 +19,7 @@ public: private: XMLDocument(JS::Realm& realm, AK::URL const& url); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp index 222085a119..e94f5235eb 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp @@ -35,12 +35,10 @@ XMLSerializer::XMLSerializer(JS::Realm& realm) XMLSerializer::~XMLSerializer() = default; -JS::ThrowCompletionOr XMLSerializer::initialize(JS::Realm& realm) +void XMLSerializer::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "XMLSerializer")); - - return {}; } // https://w3c.github.io/DOM-Parsing/#dom-xmlserializer-serializetostring diff --git a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.h b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.h index 411ce23d17..b5ba350daf 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.h +++ b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.h @@ -23,7 +23,7 @@ public: private: explicit XMLSerializer(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; enum class RequireWellFormed { diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp index eb02aa7822..6f8b29da7e 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp @@ -35,12 +35,10 @@ TextDecoder::TextDecoder(JS::Realm& realm, TextCodec::Decoder& decoder, Deprecat TextDecoder::~TextDecoder() = default; -JS::ThrowCompletionOr TextDecoder::initialize(JS::Realm& realm) +void TextDecoder::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TextDecoder")); - - return {}; } // https://encoding.spec.whatwg.org/#dom-textdecoder-decode diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.h b/Userland/Libraries/LibWeb/Encoding/TextDecoder.h index 766d2ad793..c4b8f508da 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.h +++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.h @@ -35,7 +35,7 @@ private: // https://encoding.spec.whatwg.org/#dom-textdecoder TextDecoder(JS::Realm&, TextCodec::Decoder&, DeprecatedFlyString encoding, bool fatal, bool ignore_bom); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; TextCodec::Decoder& m_decoder; DeprecatedFlyString m_encoding; diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp index 224f7df285..cb60a63ee8 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp @@ -24,12 +24,10 @@ TextEncoder::TextEncoder(JS::Realm& realm) TextEncoder::~TextEncoder() = default; -JS::ThrowCompletionOr TextEncoder::initialize(JS::Realm& realm) +void TextEncoder::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TextEncoder")); - - return {}; } // https://encoding.spec.whatwg.org/#dom-textencoder-encode diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.h b/Userland/Libraries/LibWeb/Encoding/TextEncoder.h index 3396004486..e2d7523137 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.h +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.h @@ -32,7 +32,7 @@ protected: // https://encoding.spec.whatwg.org/#dom-textencoder explicit TextEncoder(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/Fetch/Headers.cpp b/Userland/Libraries/LibWeb/Fetch/Headers.cpp index 7455494113..eeaf89249a 100644 --- a/Userland/Libraries/LibWeb/Fetch/Headers.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Headers.cpp @@ -37,12 +37,10 @@ Headers::Headers(JS::Realm& realm, JS::NonnullGCPtr Headers::~Headers() = default; -JS::ThrowCompletionOr Headers::initialize(JS::Realm& realm) +void Headers::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Headers")); - - return {}; } void Headers::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Fetch/Headers.h b/Userland/Libraries/LibWeb/Fetch/Headers.h index 559fe0c3e8..984e720ce2 100644 --- a/Userland/Libraries/LibWeb/Fetch/Headers.h +++ b/Userland/Libraries/LibWeb/Fetch/Headers.h @@ -62,7 +62,7 @@ private: Headers(JS::Realm&, JS::NonnullGCPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; WebIDL::ExceptionOr validate(Infrastructure::Header const&) const; diff --git a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp index 0de77519ec..df16eb225a 100644 --- a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp +++ b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp @@ -37,12 +37,10 @@ HeadersIterator::HeadersIterator(Headers const& headers, JS::Object::PropertyKin HeadersIterator::~HeadersIterator() = default; -JS::ThrowCompletionOr HeadersIterator::initialize(JS::Realm& realm) +void HeadersIterator::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HeadersIterator")); - - return {}; } void HeadersIterator::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h index ae9a2bcdeb..6375a40560 100644 --- a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h +++ b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.h @@ -23,7 +23,7 @@ public: JS::ThrowCompletionOr next(); private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; HeadersIterator(Headers const&, JS::Object::PropertyKind iteration_kind); diff --git a/Userland/Libraries/LibWeb/Fetch/Request.cpp b/Userland/Libraries/LibWeb/Fetch/Request.cpp index 9373743f5c..c1dfb3fbbf 100644 --- a/Userland/Libraries/LibWeb/Fetch/Request.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Request.cpp @@ -29,12 +29,10 @@ Request::Request(JS::Realm& realm, JS::NonnullGCPtr req Request::~Request() = default; -JS::ThrowCompletionOr Request::initialize(JS::Realm& realm) +void Request::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Request")); - - return {}; } void Request::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Fetch/Request.h b/Userland/Libraries/LibWeb/Fetch/Request.h index 3f54e15906..f5a923c819 100644 --- a/Userland/Libraries/LibWeb/Fetch/Request.h +++ b/Userland/Libraries/LibWeb/Fetch/Request.h @@ -102,7 +102,7 @@ public: private: Request(JS::Realm&, JS::NonnullGCPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // https://fetch.spec.whatwg.org/#concept-request-request diff --git a/Userland/Libraries/LibWeb/Fetch/Response.cpp b/Userland/Libraries/LibWeb/Fetch/Response.cpp index e60c70541b..82526baa8b 100644 --- a/Userland/Libraries/LibWeb/Fetch/Response.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Response.cpp @@ -26,12 +26,10 @@ Response::Response(JS::Realm& realm, JS::NonnullGCPtr Response::~Response() = default; -JS::ThrowCompletionOr Response::initialize(JS::Realm& realm) +void Response::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Response")); - - return {}; } void Response::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Fetch/Response.h b/Userland/Libraries/LibWeb/Fetch/Response.h index e56045bd2b..bf42ffbd4f 100644 --- a/Userland/Libraries/LibWeb/Fetch/Response.h +++ b/Userland/Libraries/LibWeb/Fetch/Response.h @@ -66,7 +66,7 @@ public: private: Response(JS::Realm&, JS::NonnullGCPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; WebIDL::ExceptionOr initialize_response(ResponseInit const&, Optional const&); diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp index 25c956c2db..d8ba7732e0 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp @@ -139,12 +139,10 @@ Blob::Blob(JS::Realm& realm, ByteBuffer byte_buffer) Blob::~Blob() = default; -JS::ThrowCompletionOr Blob::initialize(JS::Realm& realm) +void Blob::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Blob")); - - return {}; } // https://w3c.github.io/FileAPI/#ref-for-dom-blob-blob diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.h b/Userland/Libraries/LibWeb/FileAPI/Blob.h index 14cf1b4867..3657812022 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.h +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.h @@ -53,7 +53,7 @@ protected: Blob(JS::Realm&, ByteBuffer, String type); Blob(JS::Realm&, ByteBuffer); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: WebIDL::ExceptionOr> get_stream(); diff --git a/Userland/Libraries/LibWeb/FileAPI/File.cpp b/Userland/Libraries/LibWeb/FileAPI/File.cpp index cc11fdd258..679af049fd 100644 --- a/Userland/Libraries/LibWeb/FileAPI/File.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/File.cpp @@ -19,12 +19,10 @@ File::File(JS::Realm& realm, ByteBuffer byte_buffer, String file_name, String ty { } -JS::ThrowCompletionOr File::initialize(JS::Realm& realm) +void File::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "File")); - - return {}; } File::~File() = default; diff --git a/Userland/Libraries/LibWeb/FileAPI/File.h b/Userland/Libraries/LibWeb/FileAPI/File.h index 601ebb8dd8..0e2b0d3e1a 100644 --- a/Userland/Libraries/LibWeb/FileAPI/File.h +++ b/Userland/Libraries/LibWeb/FileAPI/File.h @@ -31,7 +31,7 @@ public: private: File(JS::Realm&, ByteBuffer, String file_name, String type, i64 last_modified); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; String m_name; i64 m_last_modified { 0 }; diff --git a/Userland/Libraries/LibWeb/FileAPI/FileList.cpp b/Userland/Libraries/LibWeb/FileAPI/FileList.cpp index ce85b0d2d2..45fa1b075e 100644 --- a/Userland/Libraries/LibWeb/FileAPI/FileList.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/FileList.cpp @@ -24,12 +24,10 @@ FileList::FileList(JS::Realm& realm, Vector>&& files) FileList::~FileList() = default; -JS::ThrowCompletionOr FileList::initialize(JS::Realm& realm) +void FileList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "FileList")); - - return {}; } // https://w3c.github.io/FileAPI/#dfn-item diff --git a/Userland/Libraries/LibWeb/FileAPI/FileList.h b/Userland/Libraries/LibWeb/FileAPI/FileList.h index 6227c57483..98d90796b2 100644 --- a/Userland/Libraries/LibWeb/FileAPI/FileList.h +++ b/Userland/Libraries/LibWeb/FileAPI/FileList.h @@ -42,7 +42,7 @@ public: private: FileList(JS::Realm&, Vector>&&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^Bindings::LegacyPlatformObject diff --git a/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp b/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp index 345f11753a..8c70f33f51 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp @@ -67,12 +67,10 @@ DOMMatrix::DOMMatrix(JS::Realm& realm, DOMMatrixReadOnly const& read_only_matrix DOMMatrix::~DOMMatrix() = default; -JS::ThrowCompletionOr DOMMatrix::initialize(JS::Realm& realm) +void DOMMatrix::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMMatrix")); - - return {}; } // https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-m11 diff --git a/Userland/Libraries/LibWeb/Geometry/DOMMatrix.h b/Userland/Libraries/LibWeb/Geometry/DOMMatrix.h index b6527cd3e9..c9372f2ff8 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMMatrix.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMMatrix.h @@ -52,7 +52,7 @@ private: DOMMatrix(JS::Realm&, Optional>> const& init); DOMMatrix(JS::Realm&, DOMMatrixReadOnly const& read_only_matrix); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp b/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp index 2ecf849bb7..1adaf6cb85 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp @@ -107,12 +107,10 @@ DOMMatrixReadOnly::DOMMatrixReadOnly(JS::Realm& realm, DOMMatrixReadOnly const& DOMMatrixReadOnly::~DOMMatrixReadOnly() = default; -JS::ThrowCompletionOr DOMMatrixReadOnly::initialize(JS::Realm& realm) +void DOMMatrixReadOnly::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMMatrixReadOnly")); - - return {}; } // https://drafts.fxtf.org/geometry/#create-a-2d-matrix diff --git a/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h b/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h index c5a9c476a2..e01543a611 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h @@ -98,7 +98,7 @@ private: void initialize_from_create_2d_matrix(double m11, double m12, double m21, double m22, double m41, double m42); void initialize_from_create_3d_matrix(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; WebIDL::ExceptionOr validate_and_fixup_dom_matrix_2d_init(DOMMatrix2DInit& init); diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp b/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp index 93ce969b1c..a0de36ecef 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp @@ -30,12 +30,10 @@ JS::NonnullGCPtr DOMPoint::from_point(JS::VM& vm, DOMPointInit const& DOMPoint::~DOMPoint() = default; -JS::ThrowCompletionOr DOMPoint::initialize(JS::Realm& realm) +void DOMPoint::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMPoint")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPoint.h b/Userland/Libraries/LibWeb/Geometry/DOMPoint.h index aa4037b50d..166fcb4cd8 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPoint.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMPoint.h @@ -35,7 +35,7 @@ public: private: DOMPoint(JS::Realm&, double x, double y, double z, double w); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp index c709f09472..0ec52f7b3c 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp @@ -34,12 +34,10 @@ WebIDL::ExceptionOr> DOMPointReadOnly::from_p DOMPointReadOnly::~DOMPointReadOnly() = default; -JS::ThrowCompletionOr DOMPointReadOnly::initialize(JS::Realm& realm) +void DOMPointReadOnly::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMPointReadOnly")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h index 5412f9a51b..68829f0f5f 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h @@ -39,7 +39,7 @@ public: protected: DOMPointReadOnly(JS::Realm&, double x, double y, double z, double w); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; double m_x; double m_y; diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp b/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp index c68db13834..bc179cb431 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp @@ -34,12 +34,10 @@ DOMRect::DOMRect(JS::Realm& realm, double x, double y, double width, double heig DOMRect::~DOMRect() = default; -JS::ThrowCompletionOr DOMRect::initialize(JS::Realm& realm) +void DOMRect::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMRect")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRect.h b/Userland/Libraries/LibWeb/Geometry/DOMRect.h index a6ea4900e5..c56708f57e 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRect.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMRect.h @@ -34,7 +34,7 @@ public: private: DOMRect(JS::Realm&, double x, double y, double width, double height); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp b/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp index a499fa59a9..28c8b997d5 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp @@ -28,12 +28,10 @@ DOMRectList::DOMRectList(JS::Realm& realm, Vector> rec DOMRectList::~DOMRectList() = default; -JS::ThrowCompletionOr DOMRectList::initialize(JS::Realm& realm) +void DOMRectList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMRectList")); - - return {}; } // https://drafts.fxtf.org/geometry-1/#dom-domrectlist-length diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRectList.h b/Userland/Libraries/LibWeb/Geometry/DOMRectList.h index f4cf090ec4..77956b465e 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRectList.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMRectList.h @@ -31,7 +31,7 @@ public: private: DOMRectList(JS::Realm&, Vector>); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^Bindings::LegacyPlatformObject virtual bool supports_indexed_properties() const override { return true; } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp b/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp index ea4aae386a..f84844e561 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp @@ -30,12 +30,10 @@ DOMRectReadOnly::DOMRectReadOnly(JS::Realm& realm, double x, double y, double wi DOMRectReadOnly::~DOMRectReadOnly() = default; -JS::ThrowCompletionOr DOMRectReadOnly::initialize(JS::Realm& realm) +void DOMRectReadOnly::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMRectReadOnly")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.h b/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.h index 84ec341e91..7cc01f8548 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.h @@ -43,7 +43,7 @@ public: protected: DOMRectReadOnly(JS::Realm&, double x, double y, double width, double height); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Gfx::FloatRect m_rect; }; diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp b/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp index 4c48a96e9e..63d7c534a0 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp +++ b/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp @@ -44,15 +44,13 @@ AudioTrack::~AudioTrack() s_audio_track_id_allocator.deallocate(id.value()); } -JS::ThrowCompletionOr AudioTrack::initialize(JS::Realm& realm) +void AudioTrack::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "AudioTrack")); auto id = s_audio_track_id_allocator.allocate(); - m_id = TRY_OR_THROW_OOM(realm.vm(), String::number(id)); - - return {}; + m_id = MUST(String::number(id)); } void AudioTrack::play(Badge) diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrack.h b/Userland/Libraries/LibWeb/HTML/AudioTrack.h index 3de202f28f..5ef35dd198 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrack.h +++ b/Userland/Libraries/LibWeb/HTML/AudioTrack.h @@ -40,7 +40,7 @@ public: private: AudioTrack(JS::Realm&, JS::NonnullGCPtr, NonnullRefPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // https://html.spec.whatwg.org/multipage/media.html#dom-audiotrack-id diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp b/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp index 65cb89a998..b7416fba21 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp +++ b/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp @@ -19,12 +19,10 @@ AudioTrackList::AudioTrackList(JS::Realm& realm) { } -JS::ThrowCompletionOr AudioTrackList::initialize(JS::Realm& realm) +void AudioTrackList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "AudioTrackList")); - - return {}; } // https://html.spec.whatwg.org/multipage/media.html#dom-tracklist-item diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrackList.h b/Userland/Libraries/LibWeb/HTML/AudioTrackList.h index 9898fb6592..f52c8d53ff 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrackList.h +++ b/Userland/Libraries/LibWeb/HTML/AudioTrackList.h @@ -48,7 +48,7 @@ public: private: explicit AudioTrackList(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const& property_name) const override; JS::MarkedVector> m_audio_tracks; diff --git a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp index 013f3c7ea2..103b02e75b 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp @@ -47,12 +47,10 @@ CanvasGradient::CanvasGradient(JS::Realm& realm, Gfx::GradientPaintStyle& gradie CanvasGradient::~CanvasGradient() = default; -JS::ThrowCompletionOr CanvasGradient::initialize(JS::Realm& realm) +void CanvasGradient::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CanvasGradient")); - - return {}; } // https://html.spec.whatwg.org/multipage/canvas.html#dom-canvasgradient-addcolorstop diff --git a/Userland/Libraries/LibWeb/HTML/CanvasGradient.h b/Userland/Libraries/LibWeb/HTML/CanvasGradient.h index a9dc732a93..f83d51f226 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasGradient.h +++ b/Userland/Libraries/LibWeb/HTML/CanvasGradient.h @@ -29,7 +29,7 @@ public: private: CanvasGradient(JS::Realm&, Gfx::GradientPaintStyle& gradient); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; NonnullRefPtr m_gradient; }; diff --git a/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp b/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp index 7bb2cd4077..9c560ac104 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp @@ -133,12 +133,10 @@ WebIDL::ExceptionOr> CanvasPattern::create(JS::Realm& r return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, *pattern)); } -JS::ThrowCompletionOr CanvasPattern::initialize(JS::Realm& realm) +void CanvasPattern::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CanvasPattern")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/CanvasPattern.h b/Userland/Libraries/LibWeb/HTML/CanvasPattern.h index 7bfb11192d..a3a33288a0 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasPattern.h +++ b/Userland/Libraries/LibWeb/HTML/CanvasPattern.h @@ -52,7 +52,7 @@ public: private: CanvasPattern(JS::Realm&, CanvasPatternPaintStyle&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; NonnullRefPtr m_pattern; }; diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index 205f9906ec..b62f23d2c8 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -40,12 +40,10 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(JS::Realm& realm, HTMLCanvasE CanvasRenderingContext2D::~CanvasRenderingContext2D() = default; -JS::ThrowCompletionOr CanvasRenderingContext2D::initialize(JS::Realm& realm) +void CanvasRenderingContext2D::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CanvasRenderingContext2D")); - - return {}; } void CanvasRenderingContext2D::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h index 7338bda4e6..e04189e84c 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.h @@ -103,7 +103,7 @@ public: private: explicit CanvasRenderingContext2D(JS::Realm&, HTMLCanvasElement&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; struct PreparedTextGlyph { diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp index 81edcb6dc2..f941a86b0f 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp @@ -29,12 +29,10 @@ CloseEvent::CloseEvent(JS::Realm& realm, FlyString const& event_name, CloseEvent CloseEvent::~CloseEvent() = default; -JS::ThrowCompletionOr CloseEvent::initialize(JS::Realm& realm) +void CloseEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CloseEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.h b/Userland/Libraries/LibWeb/HTML/CloseEvent.h index c0ef93a85d..9508786717 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.h +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.h @@ -34,7 +34,7 @@ public: private: CloseEvent(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; bool m_was_clean { false }; u16 m_code { 0 }; diff --git a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp index 39622a30c1..66c27c616f 100644 --- a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp +++ b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp @@ -26,12 +26,10 @@ CustomElementRegistry::CustomElementRegistry(JS::Realm& realm) CustomElementRegistry::~CustomElementRegistry() = default; -JS::ThrowCompletionOr CustomElementRegistry::initialize(JS::Realm& realm) +void CustomElementRegistry::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CustomElementRegistry")); - - return {}; } // https://webidl.spec.whatwg.org/#es-callback-function diff --git a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.h b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.h index 9fb9c1d621..98fd373c88 100644 --- a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.h +++ b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.h @@ -34,7 +34,7 @@ public: private: CustomElementRegistry(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // Every CustomElementRegistry has a set of custom element definitions, initially empty. In general, algorithms in this specification look up elements in the registry by any of name, local name, or constructor. Vector> m_custom_element_definitions; diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp index e107866e6c..0605ac6318 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -26,12 +26,10 @@ DOMParser::DOMParser(JS::Realm& realm) DOMParser::~DOMParser() = default; -JS::ThrowCompletionOr DOMParser::initialize(JS::Realm& realm) +void DOMParser::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMParser")); - - return {}; } // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.h b/Userland/Libraries/LibWeb/HTML/DOMParser.h index ff03c9d710..85f696e46b 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.h +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.h @@ -28,7 +28,7 @@ public: private: explicit DOMParser(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index 0efe3d4f7e..c52b909942 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -26,12 +26,10 @@ DOMStringMap::DOMStringMap(DOM::Element& element) DOMStringMap::~DOMStringMap() = default; -JS::ThrowCompletionOr DOMStringMap::initialize(JS::Realm& realm) +void DOMStringMap::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMStringMap")); - - return {}; } void DOMStringMap::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.h b/Userland/Libraries/LibWeb/HTML/DOMStringMap.h index 018177091f..77f89271f8 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.h +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.h @@ -31,7 +31,7 @@ public: private: explicit DOMStringMap(DOM::Element&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^LegacyPlatformObject diff --git a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp index a7f691e3f1..b716f86e1f 100644 --- a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp @@ -31,12 +31,10 @@ ErrorEvent::ErrorEvent(JS::Realm& realm, FlyString const& event_name, ErrorEvent ErrorEvent::~ErrorEvent() = default; -JS::ThrowCompletionOr ErrorEvent::initialize(JS::Realm& realm) +void ErrorEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ErrorEvent")); - - return {}; } void ErrorEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/ErrorEvent.h b/Userland/Libraries/LibWeb/HTML/ErrorEvent.h index e67b6cdf92..1c61af2f17 100644 --- a/Userland/Libraries/LibWeb/HTML/ErrorEvent.h +++ b/Userland/Libraries/LibWeb/HTML/ErrorEvent.h @@ -48,7 +48,7 @@ public: private: ErrorEvent(JS::Realm&, FlyString const& event_name, ErrorEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; String m_message; diff --git a/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp b/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp index 70cbf28c4e..a2e243c61d 100644 --- a/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp @@ -23,12 +23,10 @@ FormDataEvent::FormDataEvent(JS::Realm& realm, FlyString const& event_name, Form FormDataEvent::~FormDataEvent() = default; -JS::ThrowCompletionOr FormDataEvent::initialize(JS::Realm& realm) +void FormDataEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "FormDataEvent")); - - return {}; } void FormDataEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/FormDataEvent.h b/Userland/Libraries/LibWeb/HTML/FormDataEvent.h index cd32e21311..e983278d69 100644 --- a/Userland/Libraries/LibWeb/HTML/FormDataEvent.h +++ b/Userland/Libraries/LibWeb/HTML/FormDataEvent.h @@ -28,7 +28,7 @@ public: private: FormDataEvent(JS::Realm&, FlyString const& event_name, FormDataEventInit const& event_init); - JS::ThrowCompletionOr initialize(JS::Realm&) override; + void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp index 4a51e978d6..a49feb9d45 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp @@ -21,12 +21,10 @@ HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName HTMLAnchorElement::~HTMLAnchorElement() = default; -JS::ThrowCompletionOr HTMLAnchorElement::initialize(JS::Realm& realm) +void HTMLAnchorElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAnchorElement")); - - return {}; } void HTMLAnchorElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h index 99d61fe242..6b1b844e6d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h @@ -38,7 +38,7 @@ public: private: HTMLAnchorElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; void run_activation_behavior(Web::DOM::Event const&); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp index 97c0257340..4f372968ec 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp @@ -17,12 +17,10 @@ HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qua HTMLAreaElement::~HTMLAreaElement() = default; -JS::ThrowCompletionOr HTMLAreaElement::initialize(JS::Realm& realm) +void HTMLAreaElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAreaElement")); - - return {}; } void HTMLAreaElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h index af0b3690c1..a70cd58991 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h @@ -23,7 +23,7 @@ public: private: HTMLAreaElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^DOM::Element virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp index f006b07f27..a67faf89b8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp @@ -19,12 +19,10 @@ HTMLAudioElement::HTMLAudioElement(DOM::Document& document, DOM::QualifiedName q HTMLAudioElement::~HTMLAudioElement() = default; -JS::ThrowCompletionOr HTMLAudioElement::initialize(JS::Realm& realm) +void HTMLAudioElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAudioElement")); - - return {}; } JS::GCPtr HTMLAudioElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.h index e08554afd4..5ed8065100 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.h @@ -22,7 +22,7 @@ public: private: HTMLAudioElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual JS::GCPtr create_layout_node(NonnullRefPtr) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp index 8499debff0..a13ae96957 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp @@ -17,12 +17,10 @@ HTMLBRElement::HTMLBRElement(DOM::Document& document, DOM::QualifiedName qualifi HTMLBRElement::~HTMLBRElement() = default; -JS::ThrowCompletionOr HTMLBRElement::initialize(JS::Realm& realm) +void HTMLBRElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLBRElement")); - - return {}; } JS::GCPtr HTMLBRElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.h index 9a70829cdb..f6b1cf2f7e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.h @@ -21,7 +21,7 @@ public: private: HTMLBRElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp index 2fc849fa71..4044eb61ad 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp @@ -16,12 +16,10 @@ HTMLBaseElement::HTMLBaseElement(DOM::Document& document, DOM::QualifiedName qua HTMLBaseElement::~HTMLBaseElement() = default; -JS::ThrowCompletionOr HTMLBaseElement::initialize(JS::Realm& realm) +void HTMLBaseElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLBaseElement")); - - return {}; } void HTMLBaseElement::inserted() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h index 35cf7960b3..c12954abc8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h @@ -28,7 +28,7 @@ public: private: HTMLBaseElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual bool is_html_base_element() const override { return true; } // https://html.spec.whatwg.org/multipage/semantics.html#frozen-base-url diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 35e20b5581..d10385ffaf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -22,12 +22,10 @@ HTMLBodyElement::HTMLBodyElement(DOM::Document& document, DOM::QualifiedName qua HTMLBodyElement::~HTMLBodyElement() = default; -JS::ThrowCompletionOr HTMLBodyElement::initialize(JS::Realm& realm) +void HTMLBodyElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLBodyElement")); - - return {}; } void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h index c9c4882614..d50ca36523 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h @@ -32,7 +32,7 @@ private: // ^DOM::Node virtual bool is_html_body_element() const override { return true; } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^HTML::GlobalEventHandlers virtual EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp index d6673d2ef1..a8b60ee68d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp @@ -51,12 +51,10 @@ HTMLButtonElement::HTMLButtonElement(DOM::Document& document, DOM::QualifiedName HTMLButtonElement::~HTMLButtonElement() = default; -JS::ThrowCompletionOr HTMLButtonElement::initialize(JS::Realm& realm) +void HTMLButtonElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLButtonElement")); - - return {}; } DeprecatedString HTMLButtonElement::type() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h index 72b80c5ce2..dc1182b05d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.h @@ -26,7 +26,7 @@ class HTMLButtonElement final public: virtual ~HTMLButtonElement() override; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; enum class TypeAttributeState { #define __ENUMERATE_HTML_BUTTON_TYPE_ATTRIBUTE(_, state) state, diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index 0a5502f002..c7bbf5e9a7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -31,12 +31,10 @@ HTMLCanvasElement::HTMLCanvasElement(DOM::Document& document, DOM::QualifiedName HTMLCanvasElement::~HTMLCanvasElement() = default; -JS::ThrowCompletionOr HTMLCanvasElement::initialize(JS::Realm& realm) +void HTMLCanvasElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLCanvasElement")); - - return {}; } void HTMLCanvasElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h index 63906ebc89..625d672806 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.h @@ -41,7 +41,7 @@ public: private: HTMLCanvasElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual JS::GCPtr create_layout_node(NonnullRefPtr) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp index 26aad40aa1..eed2efc709 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp @@ -16,12 +16,10 @@ HTMLDListElement::HTMLDListElement(DOM::Document& document, DOM::QualifiedName q HTMLDListElement::~HTMLDListElement() = default; -JS::ThrowCompletionOr HTMLDListElement::initialize(JS::Realm& realm) +void HTMLDListElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDListElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.h index 3dc20a0008..d0c1dbdd8e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.h @@ -19,7 +19,7 @@ public: private: HTMLDListElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp index bfcb8d483a..0ec6a42b80 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp @@ -16,12 +16,10 @@ HTMLDataElement::HTMLDataElement(DOM::Document& document, DOM::QualifiedName qua HTMLDataElement::~HTMLDataElement() = default; -JS::ThrowCompletionOr HTMLDataElement::initialize(JS::Realm& realm) +void HTMLDataElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDataElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h index 356659c326..a00a29c11c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.h @@ -23,7 +23,7 @@ public: private: HTMLDataElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp index 62fba41c78..7c3f9619ca 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp @@ -16,12 +16,10 @@ HTMLDataListElement::HTMLDataListElement(DOM::Document& document, DOM::Qualified HTMLDataListElement::~HTMLDataListElement() = default; -JS::ThrowCompletionOr HTMLDataListElement::initialize(JS::Realm& realm) +void HTMLDataListElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDataListElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h index 5512d1e978..dc30ea2e46 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.h @@ -22,7 +22,7 @@ public: private: HTMLDataListElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index 609f70d833..38d4ecc487 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -52,12 +52,10 @@ void HTMLDetailsElement::run_details_notification_task_steps() }); } -JS::ThrowCompletionOr HTMLDetailsElement::initialize(JS::Realm& realm) +void HTMLDetailsElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDetailsElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h index 4ad879aad1..a3fd22eb58 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h @@ -29,7 +29,7 @@ public: private: HTMLDetailsElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp index 6791fb1ae9..f283602cc6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp @@ -16,12 +16,10 @@ HTMLDialogElement::HTMLDialogElement(DOM::Document& document, DOM::QualifiedName HTMLDialogElement::~HTMLDialogElement() = default; -JS::ThrowCompletionOr HTMLDialogElement::initialize(JS::Realm& realm) +void HTMLDialogElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDialogElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h index 92525425be..87d12bd7a0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.h @@ -23,7 +23,7 @@ public: private: HTMLDialogElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp index 1ea6e17034..7e76c9ee3c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp @@ -16,12 +16,10 @@ HTMLDirectoryElement::HTMLDirectoryElement(DOM::Document& document, DOM::Qualifi HTMLDirectoryElement::~HTMLDirectoryElement() = default; -JS::ThrowCompletionOr HTMLDirectoryElement::initialize(JS::Realm& realm) +void HTMLDirectoryElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDirectoryElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.h index 0bd8337a55..fd53d1dc37 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.h @@ -20,7 +20,7 @@ public: private: HTMLDirectoryElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp index 1395fb80f5..352276bef9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -35,12 +35,10 @@ void HTMLDivElement::apply_presentational_hints(CSS::StyleProperties& style) con }); } -JS::ThrowCompletionOr HTMLDivElement::initialize(JS::Realm& realm) +void HTMLDivElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDivElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h index ec47b18873..4d63f4f754 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.h @@ -24,7 +24,7 @@ protected: HTMLDivElement(DOM::Document&, DOM::QualifiedName); private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; }; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 9c6908c940..b28c639254 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -44,16 +44,12 @@ HTMLElement::HTMLElement(DOM::Document& document, DOM::QualifiedName qualified_n HTMLElement::~HTMLElement() = default; -JS::ThrowCompletionOr HTMLElement::initialize(JS::Realm& realm) +void HTMLElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLElement")); - m_dataset = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() { - return DOMStringMap::create(*this); - })); - - return {}; + m_dataset = MUST(DOMStringMap::create(*this)); } void HTMLElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.h b/Userland/Libraries/LibWeb/HTML/HTMLElement.h index 52b7b200f1..d2050a524d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.h @@ -68,7 +68,7 @@ public: protected: HTMLElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp index d6242daef2..7ba220f5c1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp @@ -16,12 +16,10 @@ HTMLEmbedElement::HTMLEmbedElement(DOM::Document& document, DOM::QualifiedName q HTMLEmbedElement::~HTMLEmbedElement() = default; -JS::ThrowCompletionOr HTMLEmbedElement::initialize(JS::Realm& realm) +void HTMLEmbedElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLEmbedElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.h b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.h index 1e67977b1e..311ad16d3a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.h @@ -19,7 +19,7 @@ public: private: HTMLEmbedElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp index cf6423d3d5..59297ca6cc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp @@ -17,12 +17,10 @@ HTMLFieldSetElement::HTMLFieldSetElement(DOM::Document& document, DOM::Qualified HTMLFieldSetElement::~HTMLFieldSetElement() = default; -JS::ThrowCompletionOr HTMLFieldSetElement::initialize(JS::Realm& realm) +void HTMLFieldSetElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFieldSetElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/form-elements.html#concept-fieldset-disabled diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h index d51654f6f4..f69b9a77c4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.h @@ -41,7 +41,7 @@ public: private: HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp index a02322129f..899e5e5502 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp @@ -19,12 +19,10 @@ HTMLFontElement::HTMLFontElement(DOM::Document& document, DOM::QualifiedName qua HTMLFontElement::~HTMLFontElement() = default; -JS::ThrowCompletionOr HTMLFontElement::initialize(JS::Realm& realm) +void HTMLFontElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFontElement")); - - return {}; } void HTMLFontElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.h index 13c5bd3c04..89a3b0783d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.h @@ -21,7 +21,7 @@ public: private: HTMLFontElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index 7440c781ef..9dbe008fb2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -37,12 +37,10 @@ HTMLFormElement::HTMLFormElement(DOM::Document& document, DOM::QualifiedName qua HTMLFormElement::~HTMLFormElement() = default; -JS::ThrowCompletionOr HTMLFormElement::initialize(JS::Realm& realm) +void HTMLFormElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFormElement")); - - return {}; } void HTMLFormElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h index 86e75ef00f..b91c91c970 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.h @@ -89,7 +89,7 @@ public: private: HTMLFormElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; ErrorOr populate_vector_with_submittable_elements_in_tree_order(JS::NonnullGCPtr element, Vector>& elements); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp index e5d2099e79..3256104e30 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp @@ -16,12 +16,10 @@ HTMLFrameElement::HTMLFrameElement(DOM::Document& document, DOM::QualifiedName q HTMLFrameElement::~HTMLFrameElement() = default; -JS::ThrowCompletionOr HTMLFrameElement::initialize(JS::Realm& realm) +void HTMLFrameElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFrameElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.h index f0cbfeb0ab..ab36507102 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.h @@ -20,7 +20,7 @@ public: private: HTMLFrameElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^DOM::Element virtual i32 default_tab_index_value() const override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp index 8e793577e0..fb8bd4bf39 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp @@ -17,12 +17,10 @@ HTMLFrameSetElement::HTMLFrameSetElement(DOM::Document& document, DOM::Qualified HTMLFrameSetElement::~HTMLFrameSetElement() = default; -JS::ThrowCompletionOr HTMLFrameSetElement::initialize(JS::Realm& realm) +void HTMLFrameSetElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFrameSetElement")); - - return {}; } void HTMLFrameSetElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h index badb7addb7..6489a1a681 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h @@ -23,7 +23,7 @@ public: private: HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; // ^HTML::GlobalEventHandlers diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp index 0286bdf7a2..f97a7814f8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp @@ -16,12 +16,10 @@ HTMLHRElement::HTMLHRElement(DOM::Document& document, DOM::QualifiedName qualifi HTMLHRElement::~HTMLHRElement() = default; -JS::ThrowCompletionOr HTMLHRElement::initialize(JS::Realm& realm) +void HTMLHRElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHRElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h index 57bc3dd5ad..d907b83673 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.h @@ -23,7 +23,7 @@ public: private: HTMLHRElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp index d961e7a72a..ff17191036 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp @@ -16,12 +16,10 @@ HTMLHeadElement::HTMLHeadElement(DOM::Document& document, DOM::QualifiedName qua HTMLHeadElement::~HTMLHeadElement() = default; -JS::ThrowCompletionOr HTMLHeadElement::initialize(JS::Realm& realm) +void HTMLHeadElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHeadElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.h b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.h index be4ab44aa7..6d88ab8034 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.h @@ -19,7 +19,7 @@ public: private: HTMLHeadElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp index f7577cd74d..49fed4e4dd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp @@ -18,12 +18,10 @@ HTMLHeadingElement::HTMLHeadingElement(DOM::Document& document, DOM::QualifiedNa HTMLHeadingElement::~HTMLHeadingElement() = default; -JS::ThrowCompletionOr HTMLHeadingElement::initialize(JS::Realm& realm) +void HTMLHeadingElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHeadingElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h index 1478170599..870b914a5e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.h @@ -31,7 +31,7 @@ public: private: HTMLHeadingElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp index db4ef5ecc2..a9f97601cc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp @@ -17,12 +17,10 @@ HTMLHtmlElement::HTMLHtmlElement(DOM::Document& document, DOM::QualifiedName qua HTMLHtmlElement::~HTMLHtmlElement() = default; -JS::ThrowCompletionOr HTMLHtmlElement::initialize(JS::Realm& realm) +void HTMLHtmlElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHtmlElement")); - - return {}; } bool HTMLHtmlElement::should_use_body_background_properties() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h index f132e32a62..0ab5bd2cf6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.h @@ -25,7 +25,7 @@ public: private: HTMLHtmlElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual bool is_html_html_element() const override { return true; } }; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 0fe0c22c66..715df6d542 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -21,12 +21,10 @@ HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, DOM::QualifiedName HTMLIFrameElement::~HTMLIFrameElement() = default; -JS::ThrowCompletionOr HTMLIFrameElement::initialize(JS::Realm& realm) +void HTMLIFrameElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLIFrameElement")); - - return {}; } JS::GCPtr HTMLIFrameElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h index 88dbb5c8ee..b618f06443 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h @@ -28,7 +28,7 @@ public: private: HTMLIFrameElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^DOM::Element virtual void inserted() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp index 1dd0b82f58..c1963dd89c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -52,14 +52,12 @@ void HTMLImageElement::finalize() browsing_context->unregister_viewport_client(*this); } -JS::ThrowCompletionOr HTMLImageElement::initialize(JS::Realm& realm) +void HTMLImageElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLImageElement")); - m_current_request = TRY_OR_THROW_OOM(vm(), ImageRequest::create(*document().page())); - - return {}; + m_current_request = MUST(ImageRequest::create(*document().page())); } void HTMLImageElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h index 6be6361bf2..a8628b67b9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h @@ -94,7 +94,7 @@ public: private: HTMLImageElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void finalize() override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 99309bab65..ce0a9422b2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -46,12 +46,10 @@ HTMLInputElement::HTMLInputElement(DOM::Document& document, DOM::QualifiedName q HTMLInputElement::~HTMLInputElement() = default; -JS::ThrowCompletionOr HTMLInputElement::initialize(JS::Realm& realm) +void HTMLInputElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLInputElement")); - - return {}; } void HTMLInputElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h index de5b62e6c2..8231d30c85 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -154,7 +154,7 @@ private: // ^DOM::Element virtual i32 default_tab_index_value() const override; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; static TypeAttributeState parse_type_attribute(StringView); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp index 980775cf8b..41cf0533e6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp @@ -16,12 +16,10 @@ HTMLLIElement::HTMLLIElement(DOM::Document& document, DOM::QualifiedName qualifi HTMLLIElement::~HTMLLIElement() = default; -JS::ThrowCompletionOr HTMLLIElement::initialize(JS::Realm& realm) +void HTMLLIElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLIElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h index 212d06bd94..50aaf76e24 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.h @@ -23,7 +23,7 @@ public: private: HTMLLIElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp index 94f9e56454..6d8372bf23 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp @@ -17,12 +17,10 @@ HTMLLabelElement::HTMLLabelElement(DOM::Document& document, DOM::QualifiedName q HTMLLabelElement::~HTMLLabelElement() = default; -JS::ThrowCompletionOr HTMLLabelElement::initialize(JS::Realm& realm) +void HTMLLabelElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLabelElement")); - - return {}; } JS::GCPtr HTMLLabelElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.h index 44f28e9aa9..489ab4db4b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.h @@ -23,7 +23,7 @@ public: private: HTMLLabelElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp index 8313f82dcd..dd004bc08d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp @@ -16,12 +16,10 @@ HTMLLegendElement::HTMLLegendElement(DOM::Document& document, DOM::QualifiedName HTMLLegendElement::~HTMLLegendElement() = default; -JS::ThrowCompletionOr HTMLLegendElement::initialize(JS::Realm& realm) +void HTMLLegendElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLegendElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.h index 23c5cd8173..dc10820eda 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.h @@ -19,7 +19,7 @@ public: private: HTMLLegendElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index d00cb2865e..1e4a6ee33e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -35,12 +35,10 @@ HTMLLinkElement::HTMLLinkElement(DOM::Document& document, DOM::QualifiedName qua HTMLLinkElement::~HTMLLinkElement() = default; -JS::ThrowCompletionOr HTMLLinkElement::initialize(JS::Realm& realm) +void HTMLLinkElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLinkElement")); - - return {}; } void HTMLLinkElement::inserted() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h index 44c5087161..ae137d288d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h @@ -38,7 +38,7 @@ public: private: HTMLLinkElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; // ^ResourceClient diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp index 318c5658a4..ebcfa407b3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp @@ -16,12 +16,10 @@ HTMLMapElement::HTMLMapElement(DOM::Document& document, DOM::QualifiedName quali HTMLMapElement::~HTMLMapElement() = default; -JS::ThrowCompletionOr HTMLMapElement::initialize(JS::Realm& realm) +void HTMLMapElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMapElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.h index 30b2a0df26..c862ba7cc1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.h @@ -19,7 +19,7 @@ public: private: HTMLMapElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp index 5f9fe1d9d1..d9afc10eef 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp @@ -19,12 +19,10 @@ HTMLMarqueeElement::HTMLMarqueeElement(DOM::Document& document, DOM::QualifiedNa HTMLMarqueeElement::~HTMLMarqueeElement() = default; -JS::ThrowCompletionOr HTMLMarqueeElement::initialize(JS::Realm& realm) +void HTMLMarqueeElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMarqueeElement")); - - return {}; } void HTMLMarqueeElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.h index cb345a54c6..3c85d41bc2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.h @@ -20,7 +20,7 @@ public: private: HTMLMarqueeElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; }; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index 9e986d14c1..dd381177e4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -47,14 +47,14 @@ HTMLMediaElement::HTMLMediaElement(DOM::Document& document, DOM::QualifiedName q HTMLMediaElement::~HTMLMediaElement() = default; -JS::ThrowCompletionOr HTMLMediaElement::initialize(JS::Realm& realm) +void HTMLMediaElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMediaElement")); - m_audio_tracks = TRY(realm.heap().allocate(realm, realm)); - m_video_tracks = TRY(realm.heap().allocate(realm, realm)); - m_document_observer = TRY(realm.heap().allocate(realm, realm, document())); + m_audio_tracks = MUST(realm.heap().allocate(realm, realm)); + m_video_tracks = MUST(realm.heap().allocate(realm, realm)); + m_document_observer = MUST(realm.heap().allocate(realm, realm, document())); // https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:media-element-82 m_document_observer->document_became_inactive = [this]() { @@ -62,8 +62,6 @@ JS::ThrowCompletionOr HTMLMediaElement::initialize(JS::Realm& realm) // the document is active again. pause_element().release_value_but_fixme_should_propagate_errors(); }; - - return {}; } // https://html.spec.whatwg.org/multipage/media.html#queue-a-media-element-task diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h index 34b1d04ea0..854238a638 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h @@ -131,7 +131,7 @@ public: protected: HTMLMediaElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp index 6507d52179..b4b7575005 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp @@ -16,12 +16,10 @@ HTMLMenuElement::HTMLMenuElement(DOM::Document& document, DOM::QualifiedName qua HTMLMenuElement::~HTMLMenuElement() = default; -JS::ThrowCompletionOr HTMLMenuElement::initialize(JS::Realm& realm) +void HTMLMenuElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMenuElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h index 2daf881fea..90e0e612ee 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.h @@ -23,7 +23,7 @@ public: private: HTMLMenuElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp index 85456fd1da..9b85a37a51 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp @@ -18,12 +18,10 @@ HTMLMetaElement::HTMLMetaElement(DOM::Document& document, DOM::QualifiedName qua HTMLMetaElement::~HTMLMetaElement() = default; -JS::ThrowCompletionOr HTMLMetaElement::initialize(JS::Realm& realm) +void HTMLMetaElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMetaElement")); - - return {}; } Optional HTMLMetaElement::http_equiv_state() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.h index 1124dbf135..2f8492e715 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.h @@ -38,7 +38,7 @@ public: private: HTMLMetaElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^DOM::Element virtual void inserted() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp index 61c2245ab7..6f8ce5e8fa 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp @@ -16,12 +16,10 @@ HTMLMeterElement::HTMLMeterElement(DOM::Document& document, DOM::QualifiedName q HTMLMeterElement::~HTMLMeterElement() = default; -JS::ThrowCompletionOr HTMLMeterElement::initialize(JS::Realm& realm) +void HTMLMeterElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMeterElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h index f690bf992f..d8bf2a74f6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.h @@ -28,7 +28,7 @@ public: private: HTMLMeterElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp index 9535e10342..e41f8e1163 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp @@ -17,12 +17,10 @@ HTMLModElement::HTMLModElement(DOM::Document& document, DOM::QualifiedName quali HTMLModElement::~HTMLModElement() = default; -JS::ThrowCompletionOr HTMLModElement::initialize(JS::Realm& realm) +void HTMLModElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLModElement")); - - return {}; } Optional HTMLModElement::default_role() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLModElement.h b/Userland/Libraries/LibWeb/HTML/HTMLModElement.h index 65bb5672a7..956ab1bc89 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLModElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLModElement.h @@ -22,7 +22,7 @@ public: private: HTMLModElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp index ae12c71934..74de79aa2b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp @@ -16,12 +16,10 @@ HTMLOListElement::HTMLOListElement(DOM::Document& document, DOM::QualifiedName q HTMLOListElement::~HTMLOListElement() = default; -JS::ThrowCompletionOr HTMLOListElement::initialize(JS::Realm& realm) +void HTMLOListElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOListElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h index 92e5a18c36..a4af74b0b7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.h @@ -23,7 +23,7 @@ public: private: HTMLOListElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 80806b4241..7e7186a1e2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -33,12 +33,10 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName HTMLObjectElement::~HTMLObjectElement() = default; -JS::ThrowCompletionOr HTMLObjectElement::initialize(JS::Realm& realm) +void HTMLObjectElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLObjectElement")); - - return {}; } void HTMLObjectElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h index fe60aad43f..bd750edb67 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h @@ -48,7 +48,7 @@ public: private: HTMLObjectElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual JS::GCPtr create_layout_node(NonnullRefPtr) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp index 0acb8d000e..77c433c961 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp @@ -16,12 +16,10 @@ HTMLOptGroupElement::HTMLOptGroupElement(DOM::Document& document, DOM::Qualified HTMLOptGroupElement::~HTMLOptGroupElement() = default; -JS::ThrowCompletionOr HTMLOptGroupElement::initialize(JS::Realm& realm) +void HTMLOptGroupElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOptGroupElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h index 033c2b42b1..d982df677a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.h @@ -23,7 +23,7 @@ public: private: HTMLOptGroupElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index 9b349aaf10..bc453b1d1d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -25,12 +25,10 @@ HTMLOptionElement::HTMLOptionElement(DOM::Document& document, DOM::QualifiedName HTMLOptionElement::~HTMLOptionElement() = default; -JS::ThrowCompletionOr HTMLOptionElement::initialize(JS::Realm& realm) +void HTMLOptionElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOptionElement")); - - return {}; } void HTMLOptionElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h index 853e665010..55fde71add 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h @@ -38,7 +38,7 @@ private: HTMLOptionElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp index e3a2a10def..4d0f4ea8cf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp @@ -25,12 +25,10 @@ HTMLOptionsCollection::HTMLOptionsCollection(DOM::ParentNode& root, Function HTMLOptionsCollection::initialize(JS::Realm& realm) +void HTMLOptionsCollection::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOptionsCollection")); - - return {}; } // https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-add diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h index da1bd85b64..c631c121b4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h @@ -27,7 +27,7 @@ public: private: HTMLOptionsCollection(DOM::ParentNode& root, Function filter); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp index 1d5063c1d5..99a9d89ba9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp @@ -16,12 +16,10 @@ HTMLOutputElement::HTMLOutputElement(DOM::Document& document, DOM::QualifiedName HTMLOutputElement::~HTMLOutputElement() = default; -JS::ThrowCompletionOr HTMLOutputElement::initialize(JS::Realm& realm) +void HTMLOutputElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOutputElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/form-elements.html#the-output-element:concept-form-reset-control diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h index 2beb9a4451..f6b582a08f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.h @@ -50,7 +50,7 @@ public: private: HTMLOutputElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp index 554938b888..43e68812a1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp @@ -18,12 +18,10 @@ HTMLParagraphElement::HTMLParagraphElement(DOM::Document& document, DOM::Qualifi HTMLParagraphElement::~HTMLParagraphElement() = default; -JS::ThrowCompletionOr HTMLParagraphElement::initialize(JS::Realm& realm) +void HTMLParagraphElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLParagraphElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h index 43abe2b14a..3ca8789dcf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.h @@ -25,7 +25,7 @@ public: private: HTMLParagraphElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp index 1dd89c3c17..b71bdbaed9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp @@ -16,12 +16,10 @@ HTMLParamElement::HTMLParamElement(DOM::Document& document, DOM::QualifiedName q HTMLParamElement::~HTMLParamElement() = default; -JS::ThrowCompletionOr HTMLParamElement::initialize(JS::Realm& realm) +void HTMLParamElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLParamElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.h b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.h index f32fc146fe..8ae224061a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.h @@ -19,7 +19,7 @@ public: private: HTMLParamElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp index f6f5d1abec..d9e4bb99a5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp @@ -16,12 +16,10 @@ HTMLPictureElement::HTMLPictureElement(DOM::Document& document, DOM::QualifiedNa HTMLPictureElement::~HTMLPictureElement() = default; -JS::ThrowCompletionOr HTMLPictureElement::initialize(JS::Realm& realm) +void HTMLPictureElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLPictureElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.h b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.h index 33d9d3d02f..c27e99ee34 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.h @@ -19,7 +19,7 @@ public: private: HTMLPictureElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp index 7adea79fae..2e42cc5dd3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp @@ -18,12 +18,10 @@ HTMLPreElement::HTMLPreElement(DOM::Document& document, DOM::QualifiedName quali HTMLPreElement::~HTMLPreElement() = default; -JS::ThrowCompletionOr HTMLPreElement::initialize(JS::Realm& realm) +void HTMLPreElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLPreElement")); - - return {}; } void HTMLPreElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h index 0dfee07ea1..2d1c5fdce9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.h @@ -23,7 +23,7 @@ public: private: HTMLPreElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; }; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp index 4b01e99891..1e16e708ed 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp @@ -21,12 +21,10 @@ HTMLProgressElement::HTMLProgressElement(DOM::Document& document, DOM::Qualified HTMLProgressElement::~HTMLProgressElement() = default; -JS::ThrowCompletionOr HTMLProgressElement::initialize(JS::Realm& realm) +void HTMLProgressElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLProgressElement")); - - return {}; } JS::GCPtr HTMLProgressElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h index 19e24bb31d..418e904d81 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.h @@ -42,7 +42,7 @@ private: // ^DOM::Node virtual bool is_html_progress_element() const final { return true; } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; void progress_position_updated(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp index 97d0de1c5f..2d0995df83 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp @@ -18,12 +18,10 @@ HTMLQuoteElement::HTMLQuoteElement(DOM::Document& document, DOM::QualifiedName q HTMLQuoteElement::~HTMLQuoteElement() = default; -JS::ThrowCompletionOr HTMLQuoteElement::initialize(JS::Realm& realm) +void HTMLQuoteElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLQuoteElement")); - - return {}; } Optional HTMLQuoteElement::default_role() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h index 57e9c99375..2941e06213 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.h @@ -21,7 +21,7 @@ public: private: HTMLQuoteElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index ff7b60d544..4279933940 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -30,12 +30,10 @@ HTMLScriptElement::HTMLScriptElement(DOM::Document& document, DOM::QualifiedName HTMLScriptElement::~HTMLScriptElement() = default; -JS::ThrowCompletionOr HTMLScriptElement::initialize(JS::Realm& realm) +void HTMLScriptElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLScriptElement")); - - return {}; } void HTMLScriptElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h index cef831052b..78abe051e9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h @@ -59,7 +59,7 @@ private: virtual bool is_html_script_element() const override { return true; } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index 78c4301efc..b5576979bf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -20,12 +20,10 @@ HTMLSelectElement::HTMLSelectElement(DOM::Document& document, DOM::QualifiedName HTMLSelectElement::~HTMLSelectElement() = default; -JS::ThrowCompletionOr HTMLSelectElement::initialize(JS::Realm& realm) +void HTMLSelectElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSelectElement")); - - return {}; } void HTMLSelectElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h index 1339ad5356..bd1040f117 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.h @@ -65,7 +65,7 @@ public: private: HTMLSelectElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^DOM::Element diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp index e1570f44e1..7a43cb4ee1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp @@ -16,12 +16,10 @@ HTMLSlotElement::HTMLSlotElement(DOM::Document& document, DOM::QualifiedName qua HTMLSlotElement::~HTMLSlotElement() = default; -JS::ThrowCompletionOr HTMLSlotElement::initialize(JS::Realm& realm) +void HTMLSlotElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSlotElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.h index 3167f98f2a..9f7cc04950 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.h @@ -19,7 +19,7 @@ public: private: HTMLSlotElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp index ef1674647c..76f994aced 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp @@ -18,12 +18,10 @@ HTMLSourceElement::HTMLSourceElement(DOM::Document& document, DOM::QualifiedName HTMLSourceElement::~HTMLSourceElement() = default; -JS::ThrowCompletionOr HTMLSourceElement::initialize(JS::Realm& realm) +void HTMLSourceElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSourceElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element:the-source-element-15 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.h index 5b57dc540f..bc8d1b7374 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.h @@ -19,7 +19,7 @@ public: private: HTMLSourceElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void inserted() override; virtual void removed_from(DOM::Node*) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp index db14bb9402..dd5559e20c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp @@ -16,12 +16,10 @@ HTMLSpanElement::HTMLSpanElement(DOM::Document& document, DOM::QualifiedName qua HTMLSpanElement::~HTMLSpanElement() = default; -JS::ThrowCompletionOr HTMLSpanElement::initialize(JS::Realm& realm) +void HTMLSpanElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSpanElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h index fc4388cf1d..0b7eacb2da 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.h @@ -23,7 +23,7 @@ public: private: HTMLSpanElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp index a40a2b8be3..020ac97c92 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp @@ -16,12 +16,10 @@ HTMLStyleElement::HTMLStyleElement(DOM::Document& document, DOM::QualifiedName q HTMLStyleElement::~HTMLStyleElement() = default; -JS::ThrowCompletionOr HTMLStyleElement::initialize(JS::Realm& realm) +void HTMLStyleElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLStyleElement")); - - return {}; } void HTMLStyleElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h index 209e8a1ef8..21e6f6e313 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.h @@ -28,7 +28,7 @@ public: private: HTMLStyleElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; DOM::StyleElementUtils m_style_element_utils; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp index 40f746380d..2b8d0c6920 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp @@ -57,11 +57,9 @@ bool HTMLSummaryElement::is_summary_for_its_parent_details() HTMLSummaryElement::~HTMLSummaryElement() = default; -JS::ThrowCompletionOr HTMLSummaryElement::initialize(JS::Realm& realm) +void HTMLSummaryElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); - - return {}; + Base::initialize(realm); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.h b/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.h index 36e0abe3b3..7676d86e44 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.h @@ -25,7 +25,7 @@ public: private: HTMLSummaryElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp index 555b7108b9..7be9125c74 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp @@ -18,12 +18,10 @@ HTMLTableCaptionElement::HTMLTableCaptionElement(DOM::Document& document, DOM::Q HTMLTableCaptionElement::~HTMLTableCaptionElement() = default; -JS::ThrowCompletionOr HTMLTableCaptionElement::initialize(JS::Realm& realm) +void HTMLTableCaptionElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableCaptionElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h index eae99b7cea..1d954a7176 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.h @@ -25,7 +25,7 @@ public: private: HTMLTableCaptionElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index dd9132754e..d216ca9840 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -23,12 +23,10 @@ HTMLTableCellElement::HTMLTableCellElement(DOM::Document& document, DOM::Qualifi HTMLTableCellElement::~HTMLTableCellElement() = default; -JS::ThrowCompletionOr HTMLTableCellElement::initialize(JS::Realm& realm) +void HTMLTableCellElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableCellElement")); - - return {}; } void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h index f84cd3301c..3eb91d7be4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.h @@ -27,7 +27,7 @@ public: private: HTMLTableCellElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; }; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp index 35e8dab791..06e94dd8b6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp @@ -16,12 +16,10 @@ HTMLTableColElement::HTMLTableColElement(DOM::Document& document, DOM::Qualified HTMLTableColElement::~HTMLTableColElement() = default; -JS::ThrowCompletionOr HTMLTableColElement::initialize(JS::Realm& realm) +void HTMLTableColElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableColElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h index 4a69c978bd..6b4a0f1da9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.h @@ -19,7 +19,7 @@ public: private: HTMLTableColElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp index 7522b518cf..55c8fa3aa4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -26,12 +26,10 @@ HTMLTableElement::HTMLTableElement(DOM::Document& document, DOM::QualifiedName q HTMLTableElement::~HTMLTableElement() = default; -JS::ThrowCompletionOr HTMLTableElement::initialize(JS::Realm& realm) +void HTMLTableElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableElement")); - - return {}; } void HTMLTableElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h index c909c29ce4..f90d7b63b6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h @@ -48,7 +48,7 @@ public: private: HTMLTableElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp index 74c55de3bf..cb4d133eb1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp @@ -27,12 +27,10 @@ HTMLTableRowElement::HTMLTableRowElement(DOM::Document& document, DOM::Qualified HTMLTableRowElement::~HTMLTableRowElement() = default; -JS::ThrowCompletionOr HTMLTableRowElement::initialize(JS::Realm& realm) +void HTMLTableRowElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableRowElement")); - - return {}; } void HTMLTableRowElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h index f4ec3340d3..496535d33e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.h @@ -30,7 +30,7 @@ public: private: HTMLTableRowElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp index 4fd9f72758..5c02ff4530 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp @@ -21,12 +21,10 @@ HTMLTableSectionElement::HTMLTableSectionElement(DOM::Document& document, DOM::Q HTMLTableSectionElement::~HTMLTableSectionElement() = default; -JS::ThrowCompletionOr HTMLTableSectionElement::initialize(JS::Realm& realm) +void HTMLTableSectionElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableSectionElement")); - - return {}; } void HTMLTableSectionElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h index a53e9100bb..9dc389acc1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h @@ -30,7 +30,7 @@ public: private: HTMLTableSectionElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr mutable m_rows; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp index f52db5b2f2..7849bf74b8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp @@ -17,15 +17,13 @@ HTMLTemplateElement::HTMLTemplateElement(DOM::Document& document, DOM::Qualified HTMLTemplateElement::~HTMLTemplateElement() = default; -JS::ThrowCompletionOr HTMLTemplateElement::initialize(JS::Realm& realm) +void HTMLTemplateElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTemplateElement")); - m_content = MUST_OR_THROW_OOM(heap().allocate(realm, m_document->appropriate_template_contents_owner_document())); + m_content = MUST(heap().allocate(realm, m_document->appropriate_template_contents_owner_document())); m_content->set_host(this); - - return {}; } void HTMLTemplateElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h index 6a6a0a42bd..2c22e19480 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h @@ -28,7 +28,7 @@ private: virtual bool is_html_template_element() const final { return true; } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr m_content; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index 3e49ad145d..ac1443b100 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -16,12 +16,10 @@ HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::Qualified HTMLTextAreaElement::~HTMLTextAreaElement() = default; -JS::ThrowCompletionOr HTMLTextAreaElement::initialize(JS::Realm& realm) +void HTMLTextAreaElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTextAreaElement")); - - return {}; } // https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h index 72f1ca4014..7d8a1601f3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h @@ -57,7 +57,7 @@ public: private: HTMLTextAreaElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^DOM::Element virtual i32 default_tab_index_value() const override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp index d0a14e5909..77692b083d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp @@ -14,12 +14,10 @@ HTMLTimeElement::HTMLTimeElement(DOM::Document& document, DOM::QualifiedName qua { } -JS::ThrowCompletionOr HTMLTimeElement::initialize(JS::Realm& realm) +void HTMLTimeElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTimeElement")); - - return {}; } HTMLTimeElement::~HTMLTimeElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h index 208fcac3b7..21ed86e2e3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.h @@ -23,7 +23,7 @@ public: private: HTMLTimeElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp index 94a663a01b..998a4b5b24 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp @@ -17,12 +17,10 @@ HTMLTitleElement::HTMLTitleElement(DOM::Document& document, DOM::QualifiedName q HTMLTitleElement::~HTMLTitleElement() = default; -JS::ThrowCompletionOr HTMLTitleElement::initialize(JS::Realm& realm) +void HTMLTitleElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTitleElement")); - - return {}; } void HTMLTitleElement::children_changed() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.h index e2dbccb9e7..545b24b6f3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.h @@ -19,7 +19,7 @@ public: private: HTMLTitleElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void children_changed() override; }; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp index 74796453bb..286d94b73a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp @@ -16,12 +16,10 @@ HTMLTrackElement::HTMLTrackElement(DOM::Document& document, DOM::QualifiedName q HTMLTrackElement::~HTMLTrackElement() = default; -JS::ThrowCompletionOr HTMLTrackElement::initialize(JS::Realm& realm) +void HTMLTrackElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTrackElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h index 804dcdd107..17be218974 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.h @@ -19,7 +19,7 @@ public: private: HTMLTrackElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp index deb8651ac1..04e1fd451c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp @@ -16,12 +16,10 @@ HTMLUListElement::HTMLUListElement(DOM::Document& document, DOM::QualifiedName q HTMLUListElement::~HTMLUListElement() = default; -JS::ThrowCompletionOr HTMLUListElement::initialize(JS::Realm& realm) +void HTMLUListElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLUListElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h index 180f2f44ab..bf36a3621d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.h @@ -23,7 +23,7 @@ public: private: HTMLUListElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp index 0b88dc1709..ae683a1b35 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp @@ -16,12 +16,10 @@ HTMLUnknownElement::HTMLUnknownElement(DOM::Document& document, DOM::QualifiedNa HTMLUnknownElement::~HTMLUnknownElement() = default; -JS::ThrowCompletionOr HTMLUnknownElement::initialize(JS::Realm& realm) +void HTMLUnknownElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLUnknownElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.h b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.h index 769bc6a7a3..9e46892771 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.h @@ -19,7 +19,7 @@ public: private: HTMLUnknownElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index 0149cae791..5279d7b0a9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -27,12 +27,10 @@ HTMLVideoElement::HTMLVideoElement(DOM::Document& document, DOM::QualifiedName q HTMLVideoElement::~HTMLVideoElement() = default; -JS::ThrowCompletionOr HTMLVideoElement::initialize(JS::Realm& realm) +void HTMLVideoElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLVideoElement")); - - return {}; } void HTMLVideoElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h index 4ef7ce490a..3fdf5e76dd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h @@ -44,7 +44,7 @@ public: private: HTMLVideoElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index 89fdf800cb..48471d7728 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -23,12 +23,10 @@ History::History(JS::Realm& realm, DOM::Document& document) History::~History() = default; -JS::ThrowCompletionOr History::initialize(JS::Realm& realm) +void History::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "History")); - - return {}; } void History::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/History.h b/Userland/Libraries/LibWeb/HTML/History.h index aad9574912..60dca160b0 100644 --- a/Userland/Libraries/LibWeb/HTML/History.h +++ b/Userland/Libraries/LibWeb/HTML/History.h @@ -30,7 +30,7 @@ public: private: History(JS::Realm&, DOM::Document&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; enum class IsPush { diff --git a/Userland/Libraries/LibWeb/HTML/ImageData.cpp b/Userland/Libraries/LibWeb/HTML/ImageData.cpp index d086fe97fd..723c25e454 100644 --- a/Userland/Libraries/LibWeb/HTML/ImageData.cpp +++ b/Userland/Libraries/LibWeb/HTML/ImageData.cpp @@ -40,12 +40,10 @@ ImageData::ImageData(JS::Realm& realm, NonnullRefPtr bitmap, JS::No ImageData::~ImageData() = default; -JS::ThrowCompletionOr ImageData::initialize(JS::Realm& realm) +void ImageData::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ImageData")); - - return {}; } void ImageData::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/ImageData.h b/Userland/Libraries/LibWeb/HTML/ImageData.h index e3ffc55490..86c25ce578 100644 --- a/Userland/Libraries/LibWeb/HTML/ImageData.h +++ b/Userland/Libraries/LibWeb/HTML/ImageData.h @@ -31,7 +31,7 @@ public: private: ImageData(JS::Realm&, NonnullRefPtr, JS::NonnullGCPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; NonnullRefPtr m_bitmap; diff --git a/Userland/Libraries/LibWeb/HTML/Location.cpp b/Userland/Libraries/LibWeb/HTML/Location.cpp index 71c5f11bc8..de13e63917 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.cpp +++ b/Userland/Libraries/LibWeb/HTML/Location.cpp @@ -36,9 +36,9 @@ void Location::visit_edges(Cell::Visitor& visitor) visitor.visit(property); } -JS::ThrowCompletionOr Location::initialize(JS::Realm& realm) +void Location::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Object::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Location")); // FIXME: Implement steps 2.-4. @@ -46,8 +46,6 @@ JS::ThrowCompletionOr Location::initialize(JS::Realm& realm) // 5. Set the value of the [[DefaultProperties]] internal slot of location to location.[[OwnPropertyKeys]](). // NOTE: In LibWeb this happens before the ESO is set up, so we must avoid location's custom [[OwnPropertyKeys]]. m_default_properties.extend(MUST(Object::internal_own_property_keys())); - - return {}; } // https://html.spec.whatwg.org/multipage/history.html#relevant-document diff --git a/Userland/Libraries/LibWeb/HTML/Location.h b/Userland/Libraries/LibWeb/HTML/Location.h index b7c4b0449d..0704997f19 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.h +++ b/Userland/Libraries/LibWeb/HTML/Location.h @@ -69,7 +69,7 @@ public: private: explicit Location(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr relevant_document() const; diff --git a/Userland/Libraries/LibWeb/HTML/MediaError.cpp b/Userland/Libraries/LibWeb/HTML/MediaError.cpp index 120c8e49f2..d65888d3d5 100644 --- a/Userland/Libraries/LibWeb/HTML/MediaError.cpp +++ b/Userland/Libraries/LibWeb/HTML/MediaError.cpp @@ -18,12 +18,10 @@ MediaError::MediaError(JS::Realm& realm, Code code, String message) { } -JS::ThrowCompletionOr MediaError::initialize(JS::Realm& realm) +void MediaError::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MediaError")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/MediaError.h b/Userland/Libraries/LibWeb/HTML/MediaError.h index 0b81f264b3..388ea74598 100644 --- a/Userland/Libraries/LibWeb/HTML/MediaError.h +++ b/Userland/Libraries/LibWeb/HTML/MediaError.h @@ -29,7 +29,7 @@ public: private: MediaError(JS::Realm&, Code code, String message); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // https://html.spec.whatwg.org/multipage/media.html#dom-mediaerror-code Code m_code; diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp index 85dd042081..56bdbd77db 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp @@ -38,12 +38,10 @@ void MessageChannel::visit_edges(Cell::Visitor& visitor) visitor.visit(m_port2.ptr()); } -JS::ThrowCompletionOr MessageChannel::initialize(JS::Realm& realm) +void MessageChannel::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MessageChannel")); - - return {}; } MessagePort* MessageChannel::port1() diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.h b/Userland/Libraries/LibWeb/HTML/MessageChannel.h index 61b5ea47c3..b347bee3ee 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageChannel.h +++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.h @@ -28,7 +28,7 @@ public: private: explicit MessageChannel(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr m_port1; diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp index 3d1cb3c037..22b7bae3fe 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp @@ -29,12 +29,10 @@ MessageEvent::MessageEvent(JS::Realm& realm, FlyString const& event_name, Messag MessageEvent::~MessageEvent() = default; -JS::ThrowCompletionOr MessageEvent::initialize(JS::Realm& realm) +void MessageEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MessageEvent")); - - return {}; } void MessageEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.h b/Userland/Libraries/LibWeb/HTML/MessageEvent.h index fe824ae5b6..83c73147e4 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.h +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.h @@ -33,7 +33,7 @@ public: String const& last_event_id() const { return m_last_event_id; } private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::Value m_data; diff --git a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp index 8e06e81fa4..37f2598ac2 100644 --- a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp @@ -26,12 +26,10 @@ MessagePort::MessagePort(JS::Realm& realm) MessagePort::~MessagePort() = default; -JS::ThrowCompletionOr MessagePort::initialize(JS::Realm& realm) +void MessagePort::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MessagePort")); - - return {}; } void MessagePort::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/MessagePort.h b/Userland/Libraries/LibWeb/HTML/MessagePort.h index c04504728a..82131a7297 100644 --- a/Userland/Libraries/LibWeb/HTML/MessagePort.h +++ b/Userland/Libraries/LibWeb/HTML/MessagePort.h @@ -51,7 +51,7 @@ public: private: explicit MessagePort(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; bool is_entangled() const { return m_remote_port; } diff --git a/Userland/Libraries/LibWeb/HTML/MimeType.cpp b/Userland/Libraries/LibWeb/HTML/MimeType.cpp index 7247dafff5..725307078f 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeType.cpp +++ b/Userland/Libraries/LibWeb/HTML/MimeType.cpp @@ -19,12 +19,10 @@ MimeType::MimeType(JS::Realm& realm, String type) MimeType::~MimeType() = default; -JS::ThrowCompletionOr MimeType::initialize(JS::Realm& realm) +void MimeType::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MimeType")); - - return {}; } // https://html.spec.whatwg.org/multipage/system-state.html#concept-mimetype-type diff --git a/Userland/Libraries/LibWeb/HTML/MimeType.h b/Userland/Libraries/LibWeb/HTML/MimeType.h index a97bf32410..ab507a3a3c 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeType.h +++ b/Userland/Libraries/LibWeb/HTML/MimeType.h @@ -25,7 +25,7 @@ public: private: MimeType(JS::Realm&, String type); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // https://html.spec.whatwg.org/multipage/system-state.html#concept-mimetype-type String m_type; diff --git a/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp b/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp index 7e9a823d54..eb3363f06d 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp +++ b/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp @@ -19,12 +19,10 @@ MimeTypeArray::MimeTypeArray(JS::Realm& realm) MimeTypeArray::~MimeTypeArray() = default; -JS::ThrowCompletionOr MimeTypeArray::initialize(JS::Realm& realm) +void MimeTypeArray::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MimeTypeArray")); - - return {}; } // https://html.spec.whatwg.org/multipage/system-state.html#pdf-viewing-support:support-named-properties-2 diff --git a/Userland/Libraries/LibWeb/HTML/MimeTypeArray.h b/Userland/Libraries/LibWeb/HTML/MimeTypeArray.h index 368c13f46b..2b3659eec4 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeTypeArray.h +++ b/Userland/Libraries/LibWeb/HTML/MimeTypeArray.h @@ -24,7 +24,7 @@ public: private: MimeTypeArray(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^Bindings::LegacyPlatformObject virtual Vector supported_property_names() const override; diff --git a/Userland/Libraries/LibWeb/HTML/Navigator.cpp b/Userland/Libraries/LibWeb/HTML/Navigator.cpp index 4f538b5ed3..ff2efaa145 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigator.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigator.cpp @@ -27,12 +27,10 @@ Navigator::Navigator(JS::Realm& realm) Navigator::~Navigator() = default; -JS::ThrowCompletionOr Navigator::initialize(JS::Realm& realm) +void Navigator::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Navigator")); - - return {}; } // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-pdfviewerenabled diff --git a/Userland/Libraries/LibWeb/HTML/Navigator.h b/Userland/Libraries/LibWeb/HTML/Navigator.h index 0bb2332cf6..4741e89505 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigator.h +++ b/Userland/Libraries/LibWeb/HTML/Navigator.h @@ -52,7 +52,7 @@ protected: private: explicit Navigator(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; JS::GCPtr m_plugin_array; JS::GCPtr m_mime_type_array; diff --git a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp index ab234a55d9..b9e3353c64 100644 --- a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp @@ -27,12 +27,10 @@ PageTransitionEvent::PageTransitionEvent(JS::Realm& realm, FlyString const& even PageTransitionEvent::~PageTransitionEvent() = default; -JS::ThrowCompletionOr PageTransitionEvent::initialize(JS::Realm& realm) +void PageTransitionEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "PageTransitionEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h index a41eefa8d8..1227edc2ca 100644 --- a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h +++ b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.h @@ -29,7 +29,7 @@ public: bool persisted() const { return m_persisted; } private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; bool m_persisted { false }; }; diff --git a/Userland/Libraries/LibWeb/HTML/Path2D.cpp b/Userland/Libraries/LibWeb/HTML/Path2D.cpp index b99a262c62..636d2d1ebd 100644 --- a/Userland/Libraries/LibWeb/HTML/Path2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/Path2D.cpp @@ -56,12 +56,10 @@ Path2D::Path2D(JS::Realm& realm, Optional, Deprecated Path2D::~Path2D() = default; -JS::ThrowCompletionOr Path2D::initialize(JS::Realm& realm) +void Path2D::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Path2D")); - - return {}; } // https://html.spec.whatwg.org/multipage/canvas.html#dom-path2d-addpath diff --git a/Userland/Libraries/LibWeb/HTML/Path2D.h b/Userland/Libraries/LibWeb/HTML/Path2D.h index 0749f6480e..68f287038c 100644 --- a/Userland/Libraries/LibWeb/HTML/Path2D.h +++ b/Userland/Libraries/LibWeb/HTML/Path2D.h @@ -31,7 +31,7 @@ public: private: Path2D(JS::Realm&, Optional, DeprecatedString>> const&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/Plugin.cpp b/Userland/Libraries/LibWeb/HTML/Plugin.cpp index 1c0446b322..c57e8dd2ad 100644 --- a/Userland/Libraries/LibWeb/HTML/Plugin.cpp +++ b/Userland/Libraries/LibWeb/HTML/Plugin.cpp @@ -20,12 +20,10 @@ Plugin::Plugin(JS::Realm& realm, String name) Plugin::~Plugin() = default; -JS::ThrowCompletionOr Plugin::initialize(JS::Realm& realm) +void Plugin::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Plugin")); - - return {}; } // https://html.spec.whatwg.org/multipage/system-state.html#dom-plugin-name diff --git a/Userland/Libraries/LibWeb/HTML/Plugin.h b/Userland/Libraries/LibWeb/HTML/Plugin.h index ba768589ee..38b228ec73 100644 --- a/Userland/Libraries/LibWeb/HTML/Plugin.h +++ b/Userland/Libraries/LibWeb/HTML/Plugin.h @@ -30,7 +30,7 @@ private: // https://html.spec.whatwg.org/multipage/system-state.html#concept-plugin-name String m_name; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^Bindings::LegacyPlatformObject virtual Vector supported_property_names() const override; diff --git a/Userland/Libraries/LibWeb/HTML/PluginArray.cpp b/Userland/Libraries/LibWeb/HTML/PluginArray.cpp index c60699f47e..69fc717b8e 100644 --- a/Userland/Libraries/LibWeb/HTML/PluginArray.cpp +++ b/Userland/Libraries/LibWeb/HTML/PluginArray.cpp @@ -19,12 +19,10 @@ PluginArray::PluginArray(JS::Realm& realm) PluginArray::~PluginArray() = default; -JS::ThrowCompletionOr PluginArray::initialize(JS::Realm& realm) +void PluginArray::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "PluginArray")); - - return {}; } // https://html.spec.whatwg.org/multipage/system-state.html#dom-pluginarray-refresh diff --git a/Userland/Libraries/LibWeb/HTML/PluginArray.h b/Userland/Libraries/LibWeb/HTML/PluginArray.h index f9c447e363..2d6739c738 100644 --- a/Userland/Libraries/LibWeb/HTML/PluginArray.h +++ b/Userland/Libraries/LibWeb/HTML/PluginArray.h @@ -25,7 +25,7 @@ public: private: PluginArray(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^Bindings::LegacyPlatformObject virtual Vector supported_property_names() const override; diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp index 0d19f44b51..23322f324f 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp @@ -35,12 +35,10 @@ void PromiseRejectionEvent::visit_edges(Cell::Visitor& visitor) visitor.visit(m_reason); } -JS::ThrowCompletionOr PromiseRejectionEvent::initialize(JS::Realm& realm) +void PromiseRejectionEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "PromiseRejectionEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h index 249a7b2bf6..5e0ac122a3 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.h @@ -36,7 +36,7 @@ public: private: PromiseRejectionEvent(JS::Realm&, FlyString const& event_name, PromiseRejectionEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr m_promise; diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp index 93aeaa0ec5..9366741fd2 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp @@ -33,11 +33,10 @@ EnvironmentSettingsObject::~EnvironmentSettingsObject() responsible_event_loop().unregister_environment_settings_object({}, *this); } -JS::ThrowCompletionOr EnvironmentSettingsObject::initialize(JS::Realm& realm) +void EnvironmentSettingsObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); m_module_map = realm.heap().allocate_without_realm(); - return {}; } void EnvironmentSettingsObject::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h index e97b5178af..eba3946dba 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.h @@ -57,7 +57,7 @@ struct EnvironmentSettingsObject JS_CELL(EnvironmentSettingsObject, JS::Cell); virtual ~EnvironmentSettingsObject() override; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-target-browsing-context JS::ExecutionContext& realm_execution_context(); diff --git a/Userland/Libraries/LibWeb/HTML/Storage.cpp b/Userland/Libraries/LibWeb/HTML/Storage.cpp index 4f4435455b..b26b143e14 100644 --- a/Userland/Libraries/LibWeb/HTML/Storage.cpp +++ b/Userland/Libraries/LibWeb/HTML/Storage.cpp @@ -23,12 +23,10 @@ Storage::Storage(JS::Realm& realm) Storage::~Storage() = default; -JS::ThrowCompletionOr Storage::initialize(JS::Realm& realm) +void Storage::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Storage")); - - return {}; } // https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-length diff --git a/Userland/Libraries/LibWeb/HTML/Storage.h b/Userland/Libraries/LibWeb/HTML/Storage.h index f297962571..d02f942f1a 100644 --- a/Userland/Libraries/LibWeb/HTML/Storage.h +++ b/Userland/Libraries/LibWeb/HTML/Storage.h @@ -34,7 +34,7 @@ public: private: explicit Storage(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // ^LegacyPlatformObject virtual WebIDL::ExceptionOr named_item_value(DeprecatedFlyString const&) const override; diff --git a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp index 3125f6831a..0417f383a3 100644 --- a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp @@ -27,12 +27,10 @@ SubmitEvent::SubmitEvent(JS::Realm& realm, FlyString const& event_name, SubmitEv SubmitEvent::~SubmitEvent() = default; -JS::ThrowCompletionOr SubmitEvent::initialize(JS::Realm& realm) +void SubmitEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SubmitEvent")); - - return {}; } void SubmitEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/SubmitEvent.h b/Userland/Libraries/LibWeb/HTML/SubmitEvent.h index f9617682e8..f48dccd169 100644 --- a/Userland/Libraries/LibWeb/HTML/SubmitEvent.h +++ b/Userland/Libraries/LibWeb/HTML/SubmitEvent.h @@ -29,7 +29,7 @@ public: private: SubmitEvent(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr m_submitter; diff --git a/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp b/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp index 235da24367..c37feeaa34 100644 --- a/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp +++ b/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp @@ -22,12 +22,10 @@ TextMetrics::TextMetrics(JS::Realm& realm) TextMetrics::~TextMetrics() = default; -JS::ThrowCompletionOr TextMetrics::initialize(JS::Realm& realm) +void TextMetrics::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TextMetrics")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/TextMetrics.h b/Userland/Libraries/LibWeb/HTML/TextMetrics.h index 1d07e8f8c2..693ea4ad13 100644 --- a/Userland/Libraries/LibWeb/HTML/TextMetrics.h +++ b/Userland/Libraries/LibWeb/HTML/TextMetrics.h @@ -47,7 +47,7 @@ public: private: explicit TextMetrics(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; double m_width { 0 }; double m_actual_bounding_box_left { 0 }; diff --git a/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp b/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp index 2dc57a25b5..37d7217c3d 100644 --- a/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp +++ b/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp @@ -16,12 +16,10 @@ TimeRanges::TimeRanges(JS::Realm& realm) { } -JS::ThrowCompletionOr TimeRanges::initialize(JS::Realm& realm) +void TimeRanges::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TimeRanges")); - - return {}; } // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-length diff --git a/Userland/Libraries/LibWeb/HTML/TimeRanges.h b/Userland/Libraries/LibWeb/HTML/TimeRanges.h index a124667d53..01714b36a2 100644 --- a/Userland/Libraries/LibWeb/HTML/TimeRanges.h +++ b/Userland/Libraries/LibWeb/HTML/TimeRanges.h @@ -22,7 +22,7 @@ public: private: explicit TimeRanges(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp b/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp index 4402fe1249..7a0f700c95 100644 --- a/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp @@ -26,12 +26,10 @@ TrackEvent::TrackEvent(JS::Realm& realm, FlyString const& event_name, TrackEvent { } -JS::ThrowCompletionOr TrackEvent::initialize(JS::Realm& realm) +void TrackEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TrackEvent")); - - return {}; } Variant, JS::Handle> TrackEvent::track() const diff --git a/Userland/Libraries/LibWeb/HTML/TrackEvent.h b/Userland/Libraries/LibWeb/HTML/TrackEvent.h index 16ae83a5db..3af9efab42 100644 --- a/Userland/Libraries/LibWeb/HTML/TrackEvent.h +++ b/Userland/Libraries/LibWeb/HTML/TrackEvent.h @@ -32,7 +32,7 @@ public: private: TrackEvent(JS::Realm&, FlyString const& event_name, TrackEventInit event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; TrackEventInit::TrackType m_track; }; diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp b/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp index 8e6de4d61c..ac7758f54b 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp +++ b/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp @@ -70,15 +70,13 @@ VideoTrack::~VideoTrack() s_video_track_id_allocator.deallocate(id.value()); } -JS::ThrowCompletionOr VideoTrack::initialize(JS::Realm& realm) +void VideoTrack::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "VideoTrack")); auto id = s_video_track_id_allocator.allocate(); - m_id = TRY_OR_THROW_OOM(realm.vm(), String::number(id)); - - return {}; + m_id = MUST(String::number(id)); } void VideoTrack::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrack.h b/Userland/Libraries/LibWeb/HTML/VideoTrack.h index acaed7c90e..558010907d 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrack.h +++ b/Userland/Libraries/LibWeb/HTML/VideoTrack.h @@ -43,7 +43,7 @@ public: private: VideoTrack(JS::Realm&, JS::NonnullGCPtr, NonnullOwnPtr); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-id diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp b/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp index f590c9fedc..605ce24a41 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp +++ b/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp @@ -19,12 +19,10 @@ VideoTrackList::VideoTrackList(JS::Realm& realm) { } -JS::ThrowCompletionOr VideoTrackList::initialize(JS::Realm& realm) +void VideoTrackList::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "VideoTrackList")); - - return {}; } // https://html.spec.whatwg.org/multipage/media.html#dom-tracklist-item diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrackList.h b/Userland/Libraries/LibWeb/HTML/VideoTrackList.h index d0f9732d12..f0d12ce755 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrackList.h +++ b/Userland/Libraries/LibWeb/HTML/VideoTrackList.h @@ -41,7 +41,7 @@ public: private: explicit VideoTrackList(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual JS::ThrowCompletionOr> internal_get_own_property(JS::PropertyKey const& property_name) const override; JS::MarkedVector> m_video_tracks; diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index c4625f2935..4c319743b3 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -820,8 +820,8 @@ WebIDL::ExceptionOr Window::initialize_web_interfaces(Badge(realm, "Window")); - MUST_OR_THROW_OOM(Bindings::WindowGlobalMixin::initialize(realm, *this)); - MUST_OR_THROW_OOM(WindowOrWorkerGlobalScopeMixin::initialize(realm)); + Bindings::WindowGlobalMixin::initialize(realm, *this); + WindowOrWorkerGlobalScopeMixin::initialize(realm); if (s_internals_object_exposed) define_direct_property("internals", MUST_OR_THROW_OOM(heap().allocate(realm, realm)), JS::default_attributes); diff --git a/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp b/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp index cdce3f7914..d9561e15e2 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp +++ b/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.cpp @@ -40,21 +40,18 @@ WindowOrWorkerGlobalScopeMixin::~WindowOrWorkerGlobalScopeMixin() = default; __ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES(PerformanceTimeline::EntryTypes::mark, UserTiming::PerformanceMark) \ __ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES(PerformanceTimeline::EntryTypes::measure, UserTiming::PerformanceMeasure) -JS::ThrowCompletionOr WindowOrWorkerGlobalScopeMixin::initialize(JS::Realm& realm) +void WindowOrWorkerGlobalScopeMixin::initialize(JS::Realm&) { - auto& vm = realm.vm(); - -#define __ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES(entry_type, cpp_class) \ - TRY_OR_THROW_OOM(vm, m_performance_entry_buffer_map.try_set(entry_type, PerformanceTimeline::PerformanceEntryTuple { \ - .performance_entry_buffer = {}, \ - .max_buffer_size = cpp_class::max_buffer_size(), \ - .available_from_timeline = cpp_class::available_from_timeline(), \ - .dropped_entries_count = 0, \ - })); +#define __ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES(entry_type, cpp_class) \ + m_performance_entry_buffer_map.set(entry_type, \ + PerformanceTimeline::PerformanceEntryTuple { \ + .performance_entry_buffer = {}, \ + .max_buffer_size = cpp_class::max_buffer_size(), \ + .available_from_timeline = cpp_class::available_from_timeline(), \ + .dropped_entries_count = 0, \ + }); ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES #undef __ENUMERATE_SUPPORTED_PERFORMANCE_ENTRY_TYPES - - return {}; } void WindowOrWorkerGlobalScopeMixin::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h b/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h index 49328a5eb3..08211eda9b 100644 --- a/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h +++ b/Userland/Libraries/LibWeb/HTML/WindowOrWorkerGlobalScope.h @@ -55,7 +55,7 @@ public: ErrorOr>> filter_buffer_map_by_name_and_type(Optional name, Optional type) const; protected: - JS::ThrowCompletionOr initialize(JS::Realm&); + void initialize(JS::Realm&); void visit_edges(JS::Cell::Visitor&); private: diff --git a/Userland/Libraries/LibWeb/HTML/Worker.cpp b/Userland/Libraries/LibWeb/HTML/Worker.cpp index 23b51fb04c..eb60175943 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -29,12 +29,10 @@ Worker::Worker(String const& script_url, WorkerOptions const options, DOM::Docum { } -JS::ThrowCompletionOr Worker::initialize(JS::Realm& realm) +void Worker::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Worker")); - - return {}; } void Worker::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/Worker.h b/Userland/Libraries/LibWeb/HTML/Worker.h index 9cf9723714..a8d809dc0e 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.h +++ b/Userland/Libraries/LibWeb/HTML/Worker.h @@ -68,7 +68,7 @@ private: return static_cast(target_vm.custom_data())->event_loop; } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; String m_script_url; diff --git a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp index 32d982fdec..620b05043f 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp +++ b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp @@ -24,14 +24,10 @@ WorkerGlobalScope::WorkerGlobalScope(JS::Realm& realm) WorkerGlobalScope::~WorkerGlobalScope() = default; -JS::ThrowCompletionOr WorkerGlobalScope::initialize(JS::Realm& realm) +void WorkerGlobalScope::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); - m_navigator = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() { - return WorkerNavigator::create(*this); - })); - - return {}; + Base::initialize(realm); + m_navigator = MUST(WorkerNavigator::create(*this)); } void WorkerGlobalScope::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.h b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.h index 1b30e5c40c..44feb2fdd7 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.h +++ b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.h @@ -71,7 +71,7 @@ protected: explicit WorkerGlobalScope(JS::Realm&); private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp b/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp index d868d46930..bb6add43c8 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp +++ b/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp @@ -23,12 +23,10 @@ WorkerNavigator::WorkerNavigator(WorkerGlobalScope& global_scope) WorkerNavigator::~WorkerNavigator() = default; -JS::ThrowCompletionOr WorkerNavigator::initialize(JS::Realm& realm) +void WorkerNavigator::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WorkerNavigator")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/HTML/WorkerNavigator.h b/Userland/Libraries/LibWeb/HTML/WorkerNavigator.h index 323cd82523..efc18d79df 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerNavigator.h +++ b/Userland/Libraries/LibWeb/HTML/WorkerNavigator.h @@ -29,7 +29,7 @@ public: private: explicit WorkerNavigator(WorkerGlobalScope&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp index d6768d00b8..e1b638fb2f 100644 --- a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp +++ b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp @@ -27,12 +27,10 @@ Performance::Performance(HTML::Window& window) Performance::~Performance() = default; -JS::ThrowCompletionOr Performance::initialize(JS::Realm& realm) +void Performance::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Performance")); - - return {}; } void Performance::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h index da92f02924..a8d6881cda 100644 --- a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h +++ b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h @@ -37,7 +37,7 @@ public: private: explicit Performance(HTML::Window&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; WebIDL::ExceptionOr convert_name_to_timestamp(JS::Realm& realm, String const& name); diff --git a/Userland/Libraries/LibWeb/Internals/Internals.cpp b/Userland/Libraries/LibWeb/Internals/Internals.cpp index fb8955bb53..503ff09a2e 100644 --- a/Userland/Libraries/LibWeb/Internals/Internals.cpp +++ b/Userland/Libraries/LibWeb/Internals/Internals.cpp @@ -18,11 +18,10 @@ Internals::Internals(JS::Realm& realm) Internals::~Internals() = default; -JS::ThrowCompletionOr Internals::initialize(JS::Realm& realm) +void Internals::initialize(JS::Realm& realm) { - TRY(Base::initialize(realm)); + Base::initialize(realm); Object::set_prototype(&Bindings::ensure_web_prototype(realm, "Internals")); - return {}; } void Internals::gc() diff --git a/Userland/Libraries/LibWeb/Internals/Internals.h b/Userland/Libraries/LibWeb/Internals/Internals.h index cf421d5771..cc58401489 100644 --- a/Userland/Libraries/LibWeb/Internals/Internals.h +++ b/Userland/Libraries/LibWeb/Internals/Internals.h @@ -20,7 +20,7 @@ public: private: explicit Internals(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp index 5282e2198b..283602790e 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp @@ -60,12 +60,10 @@ IntersectionObserver::~IntersectionObserver() }); } -JS::ThrowCompletionOr IntersectionObserver::initialize(JS::Realm& realm) +void IntersectionObserver::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "IntersectionObserver")); - - return {}; } void IntersectionObserver::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h index 117dc96448..d0efaf11e9 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h @@ -64,7 +64,7 @@ public: private: explicit IntersectionObserver(JS::Realm&, JS::GCPtr callback, Optional, JS::Handle>> const& root, Vector&& thresholds); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; // https://www.w3.org/TR/intersection-observer/#dom-intersectionobserver-callback-slot diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp index 98658daf84..645d5eb165 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp @@ -37,12 +37,10 @@ IntersectionObserverEntry::IntersectionObserverEntry(JS::Realm& realm, HighResol IntersectionObserverEntry::~IntersectionObserverEntry() = default; -JS::ThrowCompletionOr IntersectionObserverEntry::initialize(JS::Realm& realm) +void IntersectionObserverEntry::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "IntersectionObserverEntry")); - - return {}; } void IntersectionObserverEntry::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.h b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.h index 94bc6060f4..8726677ee5 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.h +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.h @@ -54,7 +54,7 @@ public: private: IntersectionObserverEntry(JS::Realm&, HighResolutionTime::DOMHighResTimeStamp time, JS::GCPtr root_bounds, JS::NonnullGCPtr bounding_client_rect, JS::NonnullGCPtr intersection_rect, bool is_intersecting, double intersection_ratio, JS::NonnullGCPtr target); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; // https://www.w3.org/TR/intersection-observer/#dom-intersectionobserverentry-time diff --git a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp index efd2c964ec..a2d53b5ac9 100644 --- a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp +++ b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp @@ -16,12 +16,10 @@ PerformanceTiming::PerformanceTiming(HTML::Window& window) PerformanceTiming::~PerformanceTiming() = default; -JS::ThrowCompletionOr PerformanceTiming::initialize(JS::Realm& realm) +void PerformanceTiming::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceTiming")); - - return {}; } void PerformanceTiming::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h index 0c564dea3a..fa711fb634 100644 --- a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h +++ b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h @@ -43,7 +43,7 @@ public: private: explicit PerformanceTiming(HTML::Window&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr m_window; diff --git a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp index ce9c8c1feb..5b2c3d4852 100644 --- a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp +++ b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp @@ -20,12 +20,10 @@ PerformanceEntry::PerformanceEntry(JS::Realm& realm, String const& name, HighRes PerformanceEntry::~PerformanceEntry() = default; -JS::ThrowCompletionOr PerformanceEntry::initialize(JS::Realm& realm) +void PerformanceEntry::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceEntry")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.h b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.h index b1c275d4e7..7a3572816f 100644 --- a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.h +++ b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.h @@ -40,7 +40,7 @@ public: protected: PerformanceEntry(JS::Realm&, String const& name, HighResolutionTime::DOMHighResTimeStamp start_time, HighResolutionTime::DOMHighResTimeStamp duration); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: // https://www.w3.org/TR/performance-timeline/#dom-performanceentry-name diff --git a/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp b/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp index 72a2ec19a2..b4641bcd4f 100644 --- a/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp +++ b/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp @@ -23,12 +23,10 @@ IdleDeadline::IdleDeadline(JS::Realm& realm, bool did_timeout) { } -JS::ThrowCompletionOr IdleDeadline::initialize(JS::Realm& realm) +void IdleDeadline::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "IdleDeadline")); - - return {}; } IdleDeadline::~IdleDeadline() = default; diff --git a/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.h b/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.h index 661dc0a4c1..1a150ca111 100644 --- a/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.h +++ b/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.h @@ -24,7 +24,7 @@ public: private: IdleDeadline(JS::Realm&, bool did_timeout); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; bool m_did_timeout { false }; }; diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp index c1fc475ba7..3655f502f3 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp @@ -25,12 +25,10 @@ ResizeObserver::ResizeObserver(JS::Realm& realm) ResizeObserver::~ResizeObserver() = default; -JS::ThrowCompletionOr ResizeObserver::initialize(JS::Realm& realm) +void ResizeObserver::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ResizeObserver")); - - return {}; } // https://drafts.csswg.org/resize-observer/#dom-resizeobserver-observe diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h index 5216a6525e..021a8c297d 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.h @@ -30,7 +30,7 @@ public: private: explicit ResizeObserver(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp index 123fbda977..6943ed1710 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp @@ -25,12 +25,10 @@ SVGAnimatedLength::SVGAnimatedLength(JS::Realm& realm, JS::NonnullGCPtr SVGAnimatedLength::initialize(JS::Realm& realm) +void SVGAnimatedLength::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGAnimatedLength")); - - return {}; } void SVGAnimatedLength::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.h b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.h index a2e8993283..a1255f52bf 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.h +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.h @@ -25,7 +25,7 @@ public: private: SVGAnimatedLength(JS::Realm&, JS::NonnullGCPtr base_val, JS::NonnullGCPtr anim_val); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_base_val; diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp index 987c61e73f..18ec1ab3a1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp @@ -23,12 +23,10 @@ SVGAnimatedNumber::SVGAnimatedNumber(JS::Realm& realm, float base_val, float ani SVGAnimatedNumber::~SVGAnimatedNumber() = default; -JS::ThrowCompletionOr SVGAnimatedNumber::initialize(JS::Realm& realm) +void SVGAnimatedNumber::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGAnimatedNumber")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.h b/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.h index f0997a59a2..a9e09af7e2 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.h +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.h @@ -28,7 +28,7 @@ public: private: SVGAnimatedNumber(JS::Realm&, float base_val, float anim_val); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; float m_base_val; float m_anim_val; diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp index a99c48878e..534d677edf 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp @@ -16,12 +16,10 @@ SVGCircleElement::SVGCircleElement(DOM::Document& document, DOM::QualifiedName q { } -JS::ThrowCompletionOr SVGCircleElement::initialize(JS::Realm& realm) +void SVGCircleElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGCircleElement")); - - return {}; } void SVGCircleElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h index f916cbd1f8..c24512c9f2 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h @@ -28,7 +28,7 @@ public: private: SVGCircleElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Optional m_path; diff --git a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp index be5ecfa64c..4ded39d8c9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp @@ -18,12 +18,10 @@ SVGClipPathElement::~SVGClipPathElement() { } -JS::ThrowCompletionOr SVGClipPathElement::initialize(JS::Realm& realm) +void SVGClipPathElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGClipPathElement")); - - return {}; } JS::GCPtr SVGClipPathElement::create_layout_node(NonnullRefPtr) diff --git a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h index c055bd9ae9..e5d562eba6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.h @@ -21,7 +21,7 @@ public: private: SVGClipPathElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp index 0bf340706c..1403ed8380 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp @@ -18,12 +18,10 @@ SVGDefsElement::~SVGDefsElement() { } -JS::ThrowCompletionOr SVGDefsElement::initialize(JS::Realm& realm) +void SVGDefsElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGDefsElement")); - - return {}; } JS::GCPtr SVGDefsElement::create_layout_node(NonnullRefPtr) diff --git a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.h b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.h index 700a9bde4c..a875239cca 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.h @@ -21,7 +21,7 @@ public: private: SVGDefsElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp index f3f64e114f..d35b6bb9c7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp @@ -20,16 +20,12 @@ SVGElement::SVGElement(DOM::Document& document, DOM::QualifiedName qualified_nam { } -JS::ThrowCompletionOr SVGElement::initialize(JS::Realm& realm) +void SVGElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGElement")); - m_dataset = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() { - return HTML::DOMStringMap::create(*this); - })); - - return {}; + m_dataset = MUST(HTML::DOMStringMap::create(*this)); } void SVGElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGElement.h index fe4ffc5d4c..5dbe24b9ec 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.h @@ -50,7 +50,7 @@ public: protected: SVGElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; void update_use_elements_that_reference_this(); diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp index 1d12d02dd1..c519fce692 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp @@ -16,12 +16,10 @@ SVGEllipseElement::SVGEllipseElement(DOM::Document& document, DOM::QualifiedName { } -JS::ThrowCompletionOr SVGEllipseElement::initialize(JS::Realm& realm) +void SVGEllipseElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGEllipseElement")); - - return {}; } void SVGEllipseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h index d6fd22741a..ca53860985 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h @@ -29,7 +29,7 @@ public: private: SVGEllipseElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Optional m_path; diff --git a/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp index 06409cd7db..2f259bf24e 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp @@ -22,28 +22,16 @@ SVGForeignObjectElement::SVGForeignObjectElement(DOM::Document& document, DOM::Q SVGForeignObjectElement::~SVGForeignObjectElement() = default; -JS::ThrowCompletionOr SVGForeignObjectElement::initialize(JS::Realm& realm) +void SVGForeignObjectElement::initialize(JS::Realm& realm) { - auto& vm = realm.vm(); - - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGForeignObjectElement")); // FIXME: These never actually get updated! - m_x = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr> { - return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0))); - })); - m_y = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr> { - return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0))); - })); - m_width = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr> { - return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0))); - })); - m_height = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr> { - return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0))); - })); - - return {}; + m_x = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0)))); + m_y = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0)))); + m_width = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0)))); + m_height = MUST(SVGAnimatedLength::create(realm, MUST(SVGLength::create(realm, 0, 0)), MUST(SVGLength::create(realm, 0, 0)))); } void SVGForeignObjectElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.h b/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.h index 7dc94e1917..4c7b2f12f0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.h @@ -27,7 +27,7 @@ public: private: SVGForeignObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp index b0962ec5d4..40b481a2db 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp @@ -15,12 +15,10 @@ SVGGeometryElement::SVGGeometryElement(DOM::Document& document, DOM::QualifiedNa { } -JS::ThrowCompletionOr SVGGeometryElement::initialize(JS::Realm& realm) +void SVGGeometryElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGGeometryElement")); - - return {}; } JS::GCPtr SVGGeometryElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h index 86a5573f6b..3a32b82e1c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.h @@ -26,7 +26,7 @@ public: protected: SVGGeometryElement(DOM::Document& document, DOM::QualifiedName qualified_name); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp index e942f8f6e9..efe984627e 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp @@ -99,11 +99,10 @@ JS::GCPtr SVGGradientElement::linked_gradient() const return {}; } -JS::ThrowCompletionOr SVGGradientElement::initialize(JS::Realm& realm) +void SVGGradientElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGGradientElement")); - return {}; } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h index 5472523a49..536d49038d 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h @@ -37,7 +37,7 @@ public: protected: SVGGradientElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; JS::GCPtr linked_gradient() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index 6783594761..6c565f3658 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -25,12 +25,10 @@ SVGGraphicsElement::SVGGraphicsElement(DOM::Document& document, DOM::QualifiedNa { } -JS::ThrowCompletionOr SVGGraphicsElement::initialize(JS::Realm& realm) +void SVGGraphicsElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGGraphicsElement")); - - return {}; } void SVGGraphicsElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h index a44e093590..6edeaa3320 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h @@ -51,7 +51,7 @@ public: protected: SVGGraphicsElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Optional svg_paint_computed_value_to_gfx_paint_style(SVGPaintContext const& paint_context, Optional const& paint_value) const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLength.cpp b/Userland/Libraries/LibWeb/SVG/SVGLength.cpp index 488c9a6146..1be1227120 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLength.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLength.cpp @@ -21,12 +21,10 @@ SVGLength::SVGLength(JS::Realm& realm, u8 unit_type, float value) { } -JS::ThrowCompletionOr SVGLength::initialize(JS::Realm& realm) +void SVGLength::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLength")); - - return {}; } SVGLength::~SVGLength() = default; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLength.h b/Userland/Libraries/LibWeb/SVG/SVGLength.h index 5e9c469aa2..048e21e5d7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLength.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLength.h @@ -27,7 +27,7 @@ public: private: SVGLength(JS::Realm&, u8 unit_type, float value); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; u8 m_unit_type { 0 }; float m_value { 0 }; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp index 4d4912f88f..1704e1e522 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp @@ -16,12 +16,10 @@ SVGLineElement::SVGLineElement(DOM::Document& document, DOM::QualifiedName quali { } -JS::ThrowCompletionOr SVGLineElement::initialize(JS::Realm& realm) +void SVGLineElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLineElement")); - - return {}; } void SVGLineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h index 9b7606283c..993395307f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h @@ -29,7 +29,7 @@ public: private: SVGLineElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Optional m_path; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp index a17ae73bb3..9a2363f04a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp @@ -18,12 +18,10 @@ SVGLinearGradientElement::SVGLinearGradientElement(DOM::Document& document, DOM: { } -JS::ThrowCompletionOr SVGLinearGradientElement::initialize(JS::Realm& realm) +void SVGLinearGradientElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLinearGradientElement")); - - return {}; } void SVGLinearGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h index a4e2b0bfc2..a445fdc0e6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h @@ -30,7 +30,7 @@ public: protected: SVGLinearGradientElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: JS::GCPtr linked_linear_gradient() const diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index 7cbdd8e780..e5a3ab17ad 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -89,12 +89,10 @@ SVGPathElement::SVGPathElement(DOM::Document& document, DOM::QualifiedName quali { } -JS::ThrowCompletionOr SVGPathElement::initialize(JS::Realm& realm) +void SVGPathElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPathElement")); - - return {}; } void SVGPathElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h index 946c80f859..bec1ef94a2 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h @@ -26,7 +26,7 @@ public: private: SVGPathElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Vector m_instructions; Optional m_path; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp index e21937b086..4fa87df75f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp @@ -16,12 +16,10 @@ SVGPolygonElement::SVGPolygonElement(DOM::Document& document, DOM::QualifiedName { } -JS::ThrowCompletionOr SVGPolygonElement::initialize(JS::Realm& realm) +void SVGPolygonElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPolygonElement")); - - return {}; } void SVGPolygonElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h index 9ac39e3e71..61ddb522b7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h @@ -23,7 +23,7 @@ public: private: SVGPolygonElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Optional m_path; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp index 078668ef33..c884c2623f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp @@ -16,12 +16,10 @@ SVGPolylineElement::SVGPolylineElement(DOM::Document& document, DOM::QualifiedNa { } -JS::ThrowCompletionOr SVGPolylineElement::initialize(JS::Realm& realm) +void SVGPolylineElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPolylineElement")); - - return {}; } void SVGPolylineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h index 110258ac97..6e7d934a63 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h @@ -23,7 +23,7 @@ public: private: SVGPolylineElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Optional m_path; diff --git a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp index 4ebd74492c..935442662a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp @@ -15,12 +15,10 @@ SVGRadialGradientElement::SVGRadialGradientElement(DOM::Document& document, DOM: { } -JS::ThrowCompletionOr SVGRadialGradientElement::initialize(JS::Realm& realm) +void SVGRadialGradientElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGRadialGradientElement")); - - return {}; } void SVGRadialGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h index cef93cddc3..55e50ff2ec 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h @@ -32,7 +32,7 @@ public: protected: SVGRadialGradientElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: JS::GCPtr linked_radial_gradient() const diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp index 1ff1fcb52a..b1559ac839 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp @@ -18,12 +18,10 @@ SVGRectElement::SVGRectElement(DOM::Document& document, DOM::QualifiedName quali { } -JS::ThrowCompletionOr SVGRectElement::initialize(JS::Realm& realm) +void SVGRectElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGRectElement")); - - return {}; } void SVGRectElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h index e73f97aab5..9af6a7f50d 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h @@ -31,7 +31,7 @@ public: private: SVGRectElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Gfx::FloatSize calculate_used_corner_radius_values() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 27c3da6dcf..135f3f653c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -23,12 +23,10 @@ SVGSVGElement::SVGSVGElement(DOM::Document& document, DOM::QualifiedName qualifi { } -JS::ThrowCompletionOr SVGSVGElement::initialize(JS::Realm& realm) +void SVGSVGElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGSVGElement")); - - return {}; } JS::GCPtr SVGSVGElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h index 3adae32d7c..df584b6e76 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h @@ -32,7 +32,7 @@ public: private: SVGSVGElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual bool is_svg_svg_element() const override { return true; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp index 0b6a3e4f0b..cda96bc0be 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp @@ -63,12 +63,10 @@ JS::NonnullGCPtr SVGStopElement::offset() const TODO(); } -JS::ThrowCompletionOr SVGStopElement::initialize(JS::Realm& realm) +void SVGStopElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGStopElement")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h index fa5acb3b35..6b46791490 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h @@ -32,7 +32,7 @@ public: private: SVGStopElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Optional m_offset; Optional m_color; diff --git a/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp index 6f12a81647..8917a55456 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp @@ -15,12 +15,10 @@ SVGStyleElement::SVGStyleElement(DOM::Document& document, DOM::QualifiedName qua SVGStyleElement::~SVGStyleElement() = default; -JS::ThrowCompletionOr SVGStyleElement::initialize(JS::Realm& realm) +void SVGStyleElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGStyleElement")); - - return {}; } void SVGStyleElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGStyleElement.h b/Userland/Libraries/LibWeb/SVG/SVGStyleElement.h index 1d4a53d1cc..e8b2a5ed70 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStyleElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGStyleElement.h @@ -27,7 +27,7 @@ public: private: SVGStyleElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // The semantics and processing of a ‘style’ and its attributes must be the same as is defined for the HTML ‘style’ element. diff --git a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp index 10af9b646f..9c55b18dae 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp @@ -21,12 +21,10 @@ SVGSymbolElement::SVGSymbolElement(DOM::Document& document, DOM::QualifiedName q { } -JS::ThrowCompletionOr SVGSymbolElement::initialize(JS::Realm& realm) +void SVGSymbolElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGSymbolElement")); - - return {}; } // https://svgwg.org/svg2-draft/struct.html#SymbolNotes diff --git a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h index 0c690a13aa..481ca2b5ba 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h @@ -23,7 +23,7 @@ public: private: SVGSymbolElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; bool is_direct_child_of_use_shadow_tree() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp index 95ebf24a74..4cb89ad5e4 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp @@ -15,12 +15,10 @@ SVGTSpanElement::SVGTSpanElement(DOM::Document& document, DOM::QualifiedName qua { } -JS::ThrowCompletionOr SVGTSpanElement::initialize(JS::Realm& realm) +void SVGTSpanElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTSpanElement")); - - return {}; } JS::GCPtr SVGTSpanElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.h b/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.h index e540434808..ef840ef812 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.h @@ -21,7 +21,7 @@ public: protected: SVGTSpanElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp index 55dc87b4f5..2091a32ab9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp @@ -23,12 +23,10 @@ SVGTextContentElement::SVGTextContentElement(DOM::Document& document, DOM::Quali { } -JS::ThrowCompletionOr SVGTextContentElement::initialize(JS::Realm& realm) +void SVGTextContentElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextContentElement")); - - return {}; } Optional SVGTextContentElement::text_anchor() const diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.h b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.h index 63d71c3b2f..7babb5b8d9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.h @@ -24,7 +24,7 @@ public: protected: SVGTextContentElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp index ee6abe5f73..114ac28e06 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp @@ -14,12 +14,10 @@ SVGTextElement::SVGTextElement(DOM::Document& document, DOM::QualifiedName quali { } -JS::ThrowCompletionOr SVGTextElement::initialize(JS::Realm& realm) +void SVGTextElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextElement")); - - return {}; } JS::GCPtr SVGTextElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextElement.h b/Userland/Libraries/LibWeb/SVG/SVGTextElement.h index 4910c9d26d..4d6adaa6dc 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTextElement.h @@ -21,7 +21,7 @@ public: protected: SVGTextElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp index b4cff1cd0a..879b0b9375 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp @@ -22,12 +22,10 @@ SVGTextPositioningElement::SVGTextPositioningElement(DOM::Document& document, DO { } -JS::ThrowCompletionOr SVGTextPositioningElement::initialize(JS::Realm& realm) +void SVGTextPositioningElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextPositioningElement")); - - return {}; } void SVGTextPositioningElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h index 7308c753c8..2742867988 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h @@ -28,7 +28,7 @@ public: protected: SVGTextPositioningElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: float m_x { 0 }; diff --git a/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp index 03590689f0..87171de945 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp @@ -15,12 +15,10 @@ SVGTitleElement::SVGTitleElement(DOM::Document& document, DOM::QualifiedName qua { } -JS::ThrowCompletionOr SVGTitleElement::initialize(JS::Realm& realm) +void SVGTitleElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTitleElement")); - - return {}; } JS::GCPtr SVGTitleElement::create_layout_node(NonnullRefPtr) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTitleElement.h b/Userland/Libraries/LibWeb/SVG/SVGTitleElement.h index f7fe41b085..ee468d9326 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTitleElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTitleElement.h @@ -16,7 +16,7 @@ class SVGTitleElement final : public SVGElement { private: SVGTitleElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual JS::GCPtr create_layout_node(NonnullRefPtr) override; virtual void children_changed() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp index b309e6c8f1..9aee188ab3 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -21,23 +21,21 @@ SVGUseElement::SVGUseElement(DOM::Document& document, DOM::QualifiedName qualifi { } -JS::ThrowCompletionOr SVGUseElement::initialize(JS::Realm& realm) +void SVGUseElement::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "SVGUseElement")); // The shadow tree is open (inspectable by script), but read-only. - auto shadow_root = TRY(heap().allocate(realm, document(), *this, Bindings::ShadowRootMode::Open)); + auto shadow_root = MUST(heap().allocate(realm, document(), *this, Bindings::ShadowRootMode::Open)); // The user agent must create a use-element shadow tree whose host is the ‘use’ element itself set_shadow_root(shadow_root); - m_document_observer = TRY(realm.heap().allocate(realm, realm, document())); + m_document_observer = MUST(realm.heap().allocate(realm, realm, document())); m_document_observer->document_completely_loaded = [this]() { clone_element_tree_as_our_shadow_tree(referenced_element()); }; - - return {}; } void SVGUseElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h index f85b21208c..55891fecf3 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h @@ -37,7 +37,7 @@ public: private: SVGUseElement(DOM::Document&, DOM::QualifiedName); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual bool is_svg_use_element() const override { return true; } diff --git a/Userland/Libraries/LibWeb/Selection/Selection.cpp b/Userland/Libraries/LibWeb/Selection/Selection.cpp index 524c892faa..546a3a5381 100644 --- a/Userland/Libraries/LibWeb/Selection/Selection.cpp +++ b/Userland/Libraries/LibWeb/Selection/Selection.cpp @@ -24,12 +24,10 @@ Selection::Selection(JS::NonnullGCPtr realm, JS::NonnullGCPtr Selection::initialize(JS::Realm& realm) +void Selection::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "Selection")); - - return {}; } // https://w3c.github.io/selection-api/#dfn-empty diff --git a/Userland/Libraries/LibWeb/Selection/Selection.h b/Userland/Libraries/LibWeb/Selection/Selection.h index dbf249a624..1a3e7214de 100644 --- a/Userland/Libraries/LibWeb/Selection/Selection.h +++ b/Userland/Libraries/LibWeb/Selection/Selection.h @@ -61,7 +61,7 @@ private: [[nodiscard]] bool is_empty() const; - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; void set_range(JS::GCPtr); diff --git a/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp b/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp index ebad7f14b4..847afb101d 100644 --- a/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp +++ b/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp @@ -36,12 +36,10 @@ WebIDL::ExceptionOr> ByteLengthQueuingStr return global_object().byte_length_queuing_strategy_size_function(); } -JS::ThrowCompletionOr ByteLengthQueuingStrategy::initialize(JS::Realm& realm) +void ByteLengthQueuingStrategy::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ByteLengthQueuingStrategy")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.h b/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.h index c4c626185d..de77eda1ee 100644 --- a/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.h +++ b/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.h @@ -36,7 +36,7 @@ public: private: explicit ByteLengthQueuingStrategy(JS::Realm&, double high_water_mark); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // https://streams.spec.whatwg.org/#bytelengthqueuingstrategy-highwatermark double m_high_water_mark { 0 }; diff --git a/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp b/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp index 6c45737638..1745bb216c 100644 --- a/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp +++ b/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp @@ -36,12 +36,10 @@ WebIDL::ExceptionOr> CountQueuingStrategy return global_object().count_queuing_strategy_size_function(); } -JS::ThrowCompletionOr CountQueuingStrategy::initialize(JS::Realm& realm) +void CountQueuingStrategy::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "CountQueuingStrategy")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.h b/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.h index af57695494..6f28d293a4 100644 --- a/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.h +++ b/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.h @@ -36,7 +36,7 @@ public: private: explicit CountQueuingStrategy(JS::Realm&, double high_water_mark); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; // https://streams.spec.whatwg.org/#countqueuingstrategy-highwatermark double m_high_water_mark { 0 }; diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp index 0c32ee8fdd..b8e799ff80 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp @@ -106,12 +106,10 @@ WebIDL::ExceptionOr ReadableStream::get_reader(ReadableStr return ReadableStreamReader { TRY(acquire_readable_stream_byob_reader(*this)) }; } -JS::ThrowCompletionOr ReadableStream::initialize(JS::Realm& realm) +void ReadableStream::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStream")); - - return {}; } void ReadableStream::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStream.h b/Userland/Libraries/LibWeb/Streams/ReadableStream.h index 425b552d6b..347e73c4f6 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStream.h +++ b/Userland/Libraries/LibWeb/Streams/ReadableStream.h @@ -68,7 +68,7 @@ public: private: explicit ReadableStream(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // https://streams.spec.whatwg.org/#readablestream-controller diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp index 8bc90c56ab..036c84995c 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp @@ -124,12 +124,10 @@ WebIDL::ExceptionOr ReadableStreamDefaultController::release_steps() return {}; } -JS::ThrowCompletionOr ReadableStreamDefaultController::initialize(JS::Realm& realm) +void ReadableStreamDefaultController::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStreamDefaultController")); - - return {}; } void ReadableStreamDefaultController::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.h b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.h index b62c8f2669..43bbd3e8ee 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.h +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.h @@ -68,7 +68,7 @@ public: WebIDL::ExceptionOr release_steps(); private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp index 515b0d10be..fe7a3dfe68 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp @@ -40,12 +40,10 @@ ReadableStreamDefaultReader::ReadableStreamDefaultReader(JS::Realm& realm) { } -JS::ThrowCompletionOr ReadableStreamDefaultReader::initialize(JS::Realm& realm) +void ReadableStreamDefaultReader::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStreamDefaultReader")); - - return {}; } void ReadableStreamDefaultReader::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.h b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.h index 1a2efa8824..eb5178335e 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.h +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.h @@ -77,7 +77,7 @@ public: private: explicit ReadableStreamDefaultReader(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/Streams/TransformStream.cpp b/Userland/Libraries/LibWeb/Streams/TransformStream.cpp index ed05e0dbf9..ff54019c50 100644 --- a/Userland/Libraries/LibWeb/Streams/TransformStream.cpp +++ b/Userland/Libraries/LibWeb/Streams/TransformStream.cpp @@ -79,12 +79,10 @@ TransformStream::TransformStream(JS::Realm& realm) TransformStream::~TransformStream() = default; -JS::ThrowCompletionOr TransformStream::initialize(JS::Realm& realm) +void TransformStream::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TransformStream")); - - return {}; } void TransformStream::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/TransformStream.h b/Userland/Libraries/LibWeb/Streams/TransformStream.h index 514fe42598..0a9bddcfdd 100644 --- a/Userland/Libraries/LibWeb/Streams/TransformStream.h +++ b/Userland/Libraries/LibWeb/Streams/TransformStream.h @@ -42,7 +42,7 @@ public: private: explicit TransformStream(JS::Realm& realm); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp b/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp index 9ca7ebe43f..dd5b072acb 100644 --- a/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp +++ b/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp @@ -17,12 +17,10 @@ TransformStreamDefaultController::TransformStreamDefaultController(JS::Realm& re TransformStreamDefaultController::~TransformStreamDefaultController() = default; -JS::ThrowCompletionOr TransformStreamDefaultController::initialize(JS::Realm& realm) +void TransformStreamDefaultController::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "TransformStreamDefaultController")); - - return {}; } void TransformStreamDefaultController::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.h b/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.h index 327b4c4cd1..8ccf196bc1 100644 --- a/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.h +++ b/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.h @@ -33,7 +33,7 @@ public: void set_stream(JS::GCPtr stream) { m_stream = stream; } private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/Streams/WritableStream.cpp b/Userland/Libraries/LibWeb/Streams/WritableStream.cpp index 1775a85893..3428eb63d5 100644 --- a/Userland/Libraries/LibWeb/Streams/WritableStream.cpp +++ b/Userland/Libraries/LibWeb/Streams/WritableStream.cpp @@ -103,12 +103,10 @@ WritableStream::WritableStream(JS::Realm& realm) { } -JS::ThrowCompletionOr WritableStream::initialize(JS::Realm& realm) +void WritableStream::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WritableStream")); - - return {}; } void WritableStream::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/WritableStream.h b/Userland/Libraries/LibWeb/Streams/WritableStream.h index 43b9eef25a..84a1fdaba3 100644 --- a/Userland/Libraries/LibWeb/Streams/WritableStream.h +++ b/Userland/Libraries/LibWeb/Streams/WritableStream.h @@ -87,7 +87,7 @@ public: private: explicit WritableStream(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp b/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp index 60c31ccabf..9996e2e998 100644 --- a/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp +++ b/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp @@ -123,12 +123,10 @@ WritableStreamDefaultWriter::WritableStreamDefaultWriter(JS::Realm& realm) { } -JS::ThrowCompletionOr WritableStreamDefaultWriter::initialize(JS::Realm& realm) +void WritableStreamDefaultWriter::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WritableStreamDefaultWriter")); - - return {}; } void WritableStreamDefaultWriter::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.h b/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.h index 4abda8cec9..98d7dc7e3a 100644 --- a/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.h +++ b/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.h @@ -45,7 +45,7 @@ public: private: explicit WritableStreamDefaultWriter(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp index 635a4779e6..868d399b7c 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp @@ -22,12 +22,10 @@ FocusEvent::FocusEvent(JS::Realm& realm, FlyString const& event_name, FocusEvent FocusEvent::~FocusEvent() = default; -JS::ThrowCompletionOr FocusEvent::initialize(JS::Realm& realm) +void FocusEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "FocusEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h index 156f0f58f6..1494706096 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h @@ -26,7 +26,7 @@ public: private: FocusEvent(JS::Realm&, FlyString const& event_name, FocusEventInit const&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp index 0d0d465d6b..5fa279c9b9 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp @@ -570,12 +570,10 @@ KeyboardEvent::KeyboardEvent(JS::Realm& realm, FlyString const& event_name, Keyb KeyboardEvent::~KeyboardEvent() = default; -JS::ThrowCompletionOr KeyboardEvent::initialize(JS::Realm& realm) +void KeyboardEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "KeyboardEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h index 787509aac5..9f2ef054f8 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h @@ -64,7 +64,7 @@ public: private: KeyboardEvent(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; String m_key; String m_code; diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp index b091b37339..39f69d07d3 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp @@ -29,12 +29,10 @@ MouseEvent::MouseEvent(JS::Realm& realm, FlyString const& event_name, MouseEvent MouseEvent::~MouseEvent() = default; -JS::ThrowCompletionOr MouseEvent::initialize(JS::Realm& realm) +void MouseEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "MouseEvent")); - - return {}; } // https://www.w3.org/TR/uievents/#dom-mouseevent-button diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h index 35a85bf233..394bf31736 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h @@ -58,7 +58,7 @@ public: protected: MouseEvent(JS::Realm&, FlyString const& event_name, MouseEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: void set_event_characteristics(); diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp index 40f8f0bfd3..2c3c6e8e30 100644 --- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp @@ -33,12 +33,10 @@ UIEvent::UIEvent(JS::Realm& realm, FlyString const& event_name, UIEventInit cons UIEvent::~UIEvent() = default; -JS::ThrowCompletionOr UIEvent::initialize(JS::Realm& realm) +void UIEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "UIEvent")); - - return {}; } void UIEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h index 19bf8c0fcf..02346315fc 100644 --- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h @@ -41,7 +41,7 @@ protected: UIEvent(JS::Realm&, FlyString const& event_name); UIEvent(JS::Realm&, FlyString const& event_name, UIEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::GCPtr m_view; diff --git a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp index 982539129d..31a11b8958 100644 --- a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp @@ -23,12 +23,10 @@ WheelEvent::WheelEvent(JS::Realm& realm, FlyString const& event_name, WheelEvent WheelEvent::~WheelEvent() = default; -JS::ThrowCompletionOr WheelEvent::initialize(JS::Realm& realm) +void WheelEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WheelEvent")); - - return {}; } WebIDL::ExceptionOr> WheelEvent::create(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init) diff --git a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h index 855eb1fe52..93a1460c6f 100644 --- a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h @@ -42,7 +42,7 @@ public: private: WheelEvent(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; void set_event_characteristics(); diff --git a/Userland/Libraries/LibWeb/URL/URL.cpp b/Userland/Libraries/LibWeb/URL/URL.cpp index 1daad7d438..a1a6a94311 100644 --- a/Userland/Libraries/LibWeb/URL/URL.cpp +++ b/Userland/Libraries/LibWeb/URL/URL.cpp @@ -84,12 +84,10 @@ URL::URL(JS::Realm& realm, AK::URL url, JS::NonnullGCPtr query) URL::~URL() = default; -JS::ThrowCompletionOr URL::initialize(JS::Realm& realm) +void URL::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "URL")); - - return {}; } void URL::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/URL/URL.h b/Userland/Libraries/LibWeb/URL/URL.h index 1cba47b8da..2da8b0fcbc 100644 --- a/Userland/Libraries/LibWeb/URL/URL.h +++ b/Userland/Libraries/LibWeb/URL/URL.h @@ -70,7 +70,7 @@ public: private: URL(JS::Realm&, AK::URL, JS::NonnullGCPtr query); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; AK::URL m_url; diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp index 35cf1ffc79..10767229c9 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp +++ b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp @@ -25,12 +25,10 @@ URLSearchParams::URLSearchParams(JS::Realm& realm, Vector list) URLSearchParams::~URLSearchParams() = default; -JS::ThrowCompletionOr URLSearchParams::initialize(JS::Realm& realm) +void URLSearchParams::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "URLSearchParams")); - - return {}; } void URLSearchParams::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParams.h b/Userland/Libraries/LibWeb/URL/URLSearchParams.h index f251cd7472..f248e41380 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParams.h +++ b/Userland/Libraries/LibWeb/URL/URLSearchParams.h @@ -49,7 +49,7 @@ private: URLSearchParams(JS::Realm&, Vector list); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; WebIDL::ExceptionOr update(); diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp index fcb4c7af9c..b4937eee44 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp +++ b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.cpp @@ -37,12 +37,10 @@ URLSearchParamsIterator::URLSearchParamsIterator(URLSearchParams const& url_sear URLSearchParamsIterator::~URLSearchParamsIterator() = default; -JS::ThrowCompletionOr URLSearchParamsIterator::initialize(JS::Realm& realm) +void URLSearchParamsIterator::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "URLSearchParamsIterator")); - - return {}; } void URLSearchParamsIterator::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h index 08d7fd6d1b..7b2d81b2d4 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h +++ b/Userland/Libraries/LibWeb/URL/URLSearchParamsIterator.h @@ -24,7 +24,7 @@ public: private: URLSearchParamsIterator(URLSearchParams const&, JS::Object::PropertyKind iteration_kind); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_url_search_params; diff --git a/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp b/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp index af7c96d60f..d3ed05d9aa 100644 --- a/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp +++ b/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp @@ -96,12 +96,10 @@ FlyString const& PerformanceMark::entry_type() const return PerformanceTimeline::EntryTypes::mark; } -JS::ThrowCompletionOr PerformanceMark::initialize(JS::Realm& realm) +void PerformanceMark::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceMark")); - - return {}; } void PerformanceMark::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.h b/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.h index 8a731739d9..fd79baa36e 100644 --- a/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.h +++ b/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.h @@ -45,7 +45,7 @@ public: private: PerformanceMark(JS::Realm&, String const& name, HighResolutionTime::DOMHighResTimeStamp start_time, HighResolutionTime::DOMHighResTimeStamp duration, JS::Value detail); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; // https://w3c.github.io/user-timing/#dom-performancemark-detail diff --git a/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp b/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp index 5afaed4aa2..ee6f8117b3 100644 --- a/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp +++ b/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp @@ -34,12 +34,10 @@ FlyString const& PerformanceMeasure::entry_type() const return PerformanceTimeline::EntryTypes::measure; } -JS::ThrowCompletionOr PerformanceMeasure::initialize(JS::Realm& realm) +void PerformanceMeasure::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceMeasure")); - - return {}; } void PerformanceMeasure::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.h b/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.h index 478acf930c..7cd9aba204 100644 --- a/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.h +++ b/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.h @@ -47,7 +47,7 @@ public: private: PerformanceMeasure(JS::Realm&, String const& name, HighResolutionTime::DOMHighResTimeStamp start_time, HighResolutionTime::DOMHighResTimeStamp duration, JS::Value detail); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; // https://w3c.github.io/user-timing/#dom-performancemeasure-detail diff --git a/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp b/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp index 87d4da7151..3ae7aef44b 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp @@ -38,19 +38,19 @@ Instance::Instance(JS::Realm& realm, size_t index) { } -JS::ThrowCompletionOr Instance::initialize(JS::Realm& realm) +void Instance::initialize(JS::Realm& realm) { auto& vm = this->vm(); - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Instance"sv)); auto& instance = *Detail::s_instantiated_modules[m_index]; auto& cache = Detail::s_module_caches.at(m_index); for (auto& export_ : instance.exports()) { - TRY(export_.value().visit( - [&](Wasm::FunctionAddress const& address) -> JS::ThrowCompletionOr { + export_.value().visit( + [&](Wasm::FunctionAddress const& address) { Optional> object = cache.function_instances.get(address); if (!object.has_value()) { object = Detail::create_native_function(vm, address, export_.name()); @@ -58,36 +58,31 @@ JS::ThrowCompletionOr Instance::initialize(JS::Realm& realm) } m_exports->define_direct_property(export_.name(), *object, JS::default_attributes); - return {}; }, - [&](Wasm::MemoryAddress const& address) -> JS::ThrowCompletionOr { + [&](Wasm::MemoryAddress const& address) { Optional> object = cache.memory_instances.get(address); if (!object.has_value()) { - object = MUST_OR_THROW_OOM(heap().allocate(realm, realm, address)); + object = MUST(heap().allocate(realm, realm, address)); cache.memory_instances.set(address, *object); } m_exports->define_direct_property(export_.name(), *object, JS::default_attributes); - return {}; }, - [&](Wasm::TableAddress const& address) -> JS::ThrowCompletionOr { + [&](Wasm::TableAddress const& address) { Optional> object = cache.table_instances.get(address); if (!object.has_value()) { - object = MUST_OR_THROW_OOM(heap().allocate(realm, realm, address)); + object = MUST(heap().allocate
(realm, realm, address)); cache.table_instances.set(address, *object); } m_exports->define_direct_property(export_.name(), *object, JS::default_attributes); - return {}; }, - [&](auto const&) -> JS::ThrowCompletionOr { + [&](auto const&) { // FIXME: Implement other exports! - return {}; - })); + }); } MUST(m_exports->set_integrity_level(IntegrityLevel::Frozen)); - return {}; } void Instance::visit_edges(Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/WebAssembly/Instance.h b/Userland/Libraries/LibWeb/WebAssembly/Instance.h index c3f4380d01..0c36f89ee6 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Instance.h +++ b/Userland/Libraries/LibWeb/WebAssembly/Instance.h @@ -27,7 +27,7 @@ public: private: Instance(JS::Realm&, size_t index); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Visitor&) override; JS::NonnullGCPtr m_exports; diff --git a/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp b/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp index c7ff4a5121..19c16f1801 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp @@ -39,12 +39,10 @@ Memory::Memory(JS::Realm& realm, Wasm::MemoryAddress address) { } -JS::ThrowCompletionOr Memory::initialize(JS::Realm& realm) +void Memory::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Memory"sv)); - - return {}; } // https://webassembly.github.io/spec/js-api/#dom-memory-grow diff --git a/Userland/Libraries/LibWeb/WebAssembly/Memory.h b/Userland/Libraries/LibWeb/WebAssembly/Memory.h index f8b63ee960..3176ad0d52 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Memory.h +++ b/Userland/Libraries/LibWeb/WebAssembly/Memory.h @@ -36,7 +36,7 @@ public: private: Memory(JS::Realm&, Wasm::MemoryAddress); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; WebIDL::ExceptionOr reset_the_memory_buffer(); static WebIDL::ExceptionOr> create_a_memory_buffer(JS::VM&, JS::Realm&, Wasm::MemoryAddress); diff --git a/Userland/Libraries/LibWeb/WebAssembly/Module.cpp b/Userland/Libraries/LibWeb/WebAssembly/Module.cpp index d02d945f78..b92db841c5 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Module.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Module.cpp @@ -28,12 +28,10 @@ Module::Module(JS::Realm& realm, size_t index) { } -JS::ThrowCompletionOr Module::initialize(JS::Realm& realm) +void Module::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Module"sv)); - - return {}; } Wasm::Module const& Module::module() const diff --git a/Userland/Libraries/LibWeb/WebAssembly/Module.h b/Userland/Libraries/LibWeb/WebAssembly/Module.h index 701ecab4eb..e5fb0bc56e 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Module.h +++ b/Userland/Libraries/LibWeb/WebAssembly/Module.h @@ -28,7 +28,7 @@ public: private: Module(JS::Realm&, size_t index); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; size_t m_index { 0 }; }; diff --git a/Userland/Libraries/LibWeb/WebAssembly/Table.cpp b/Userland/Libraries/LibWeb/WebAssembly/Table.cpp index 5f86a5deff..a2e4354aee 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Table.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Table.cpp @@ -61,12 +61,10 @@ Table::Table(JS::Realm& realm, Wasm::TableAddress address) { } -JS::ThrowCompletionOr Table::initialize(JS::Realm& realm) +void Table::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Table"sv)); - - return {}; } // https://webassembly.github.io/spec/js-api/#dom-table-grow diff --git a/Userland/Libraries/LibWeb/WebAssembly/Table.h b/Userland/Libraries/LibWeb/WebAssembly/Table.h index 2db1a03fe0..b70fb06509 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Table.h +++ b/Userland/Libraries/LibWeb/WebAssembly/Table.h @@ -42,7 +42,7 @@ public: private: Table(JS::Realm&, Wasm::TableAddress); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; Wasm::TableAddress m_address; }; diff --git a/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp b/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp index 4a261f3f24..35882baa0e 100644 --- a/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp +++ b/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp @@ -79,12 +79,10 @@ AudioContext::AudioContext(JS::Realm& realm, AudioContextOptions const& context_ AudioContext::~AudioContext() = default; -JS::ThrowCompletionOr AudioContext::initialize(JS::Realm& realm) +void AudioContext::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "AudioContext")); - - return {}; } void AudioContext::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/WebAudio/AudioContext.h b/Userland/Libraries/LibWeb/WebAudio/AudioContext.h index c35d2788e7..8cdfa7aa52 100644 --- a/Userland/Libraries/LibWeb/WebAudio/AudioContext.h +++ b/Userland/Libraries/LibWeb/WebAudio/AudioContext.h @@ -41,7 +41,7 @@ public: private: explicit AudioContext(JS::Realm&, AudioContextOptions const& context_options); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; double m_base_latency { 0 }; diff --git a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp index 7ce5f69436..d6e3da2dcc 100644 --- a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp +++ b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp @@ -17,12 +17,10 @@ BaseAudioContext::BaseAudioContext(JS::Realm& realm) BaseAudioContext::~BaseAudioContext() = default; -JS::ThrowCompletionOr BaseAudioContext::initialize(JS::Realm& realm) +void BaseAudioContext::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "BaseAudioContext")); - - return {}; } void BaseAudioContext::set_onstatechange(WebIDL::CallbackType* event_handler) diff --git a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h index 68783993bb..a9e80dcd12 100644 --- a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h +++ b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h @@ -32,7 +32,7 @@ public: protected: explicit BaseAudioContext(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: float m_sample_rate { 0 }; diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp index 61baa636d2..c9a57491e3 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp @@ -27,12 +27,10 @@ WebGLContextEvent::WebGLContextEvent(JS::Realm& realm, FlyString const& type, We WebGLContextEvent::~WebGLContextEvent() = default; -JS::ThrowCompletionOr WebGLContextEvent::initialize(JS::Realm& realm) +void WebGLContextEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WebGLContextEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h index 28d0dd584e..bf2cb811eb 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.h @@ -30,7 +30,7 @@ public: private: WebGLContextEvent(JS::Realm&, FlyString const& type, WebGLContextEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; String m_status_message; }; diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp index 99819a1497..6f5ecf3b1c 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp @@ -57,12 +57,10 @@ WebGLRenderingContext::WebGLRenderingContext(JS::Realm& realm, HTML::HTMLCanvasE WebGLRenderingContext::~WebGLRenderingContext() = default; -JS::ThrowCompletionOr WebGLRenderingContext::initialize(JS::Realm& realm) +void WebGLRenderingContext::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WebGLRenderingContext")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.h b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.h index 6eba5402a4..b31a6742ee 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.h +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.h @@ -21,7 +21,7 @@ public: virtual ~WebGLRenderingContext() override; private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; WebGLRenderingContext(JS::Realm&, HTML::HTMLCanvasElement&, NonnullOwnPtr context, WebGLContextAttributes context_creation_parameters, WebGLContextAttributes actual_context_parameters); }; diff --git a/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp b/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp index 309ef1d2d5..8304b2c3a5 100644 --- a/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp +++ b/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp @@ -28,12 +28,10 @@ DOMException::DOMException(JS::Realm& realm, DeprecatedFlyString const& name, De DOMException::~DOMException() = default; -JS::ThrowCompletionOr DOMException::initialize(JS::Realm& realm) +void DOMException::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "DOMException")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/WebIDL/DOMException.h b/Userland/Libraries/LibWeb/WebIDL/DOMException.h index 1ba5993bd8..9753ce344e 100644 --- a/Userland/Libraries/LibWeb/WebIDL/DOMException.h +++ b/Userland/Libraries/LibWeb/WebIDL/DOMException.h @@ -108,7 +108,7 @@ public: protected: DOMException(JS::Realm&, DeprecatedFlyString const& name, DeprecatedFlyString const& message); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; private: DeprecatedFlyString m_name; diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp index ef8d7d1483..6699af290c 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp @@ -128,12 +128,10 @@ WebSocket::WebSocket(JS::Realm& realm) WebSocket::~WebSocket() = default; -JS::ThrowCompletionOr WebSocket::initialize(JS::Realm& realm) +void WebSocket::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "WebSocket")); - - return {}; } ErrorOr WebSocket::establish_web_socket_connection(AK::URL& url_record, Vector& protocols, HTML::EnvironmentSettingsObject& client) diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h index fc35ead49b..9d7ba33a2c 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h @@ -70,7 +70,7 @@ private: WebSocket(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; ErrorOr establish_web_socket_connection(AK::URL& url_record, Vector& protocols, HTML::EnvironmentSettingsObject& client); diff --git a/Userland/Libraries/LibWeb/XHR/FormData.cpp b/Userland/Libraries/LibWeb/XHR/FormData.cpp index ca9fe5ef72..31523e199b 100644 --- a/Userland/Libraries/LibWeb/XHR/FormData.cpp +++ b/Userland/Libraries/LibWeb/XHR/FormData.cpp @@ -46,12 +46,10 @@ FormData::FormData(JS::Realm& realm, Vector entry_list) FormData::~FormData() = default; -JS::ThrowCompletionOr FormData::initialize(JS::Realm& realm) +void FormData::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "FormData")); - - return {}; } // https://xhr.spec.whatwg.org/#dom-formdata-append diff --git a/Userland/Libraries/LibWeb/XHR/FormData.h b/Userland/Libraries/LibWeb/XHR/FormData.h index 56734a2784..893f5a1d53 100644 --- a/Userland/Libraries/LibWeb/XHR/FormData.h +++ b/Userland/Libraries/LibWeb/XHR/FormData.h @@ -51,7 +51,7 @@ private: explicit FormData(JS::Realm&, Vector entry_list = {}); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; WebIDL::ExceptionOr append_impl(String const& name, Variant, String> const& value, Optional const& filename = {}); WebIDL::ExceptionOr set_impl(String const& name, Variant, String> const& value, Optional const& filename = {}); diff --git a/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp b/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp index 95ae5af304..64e6395ea7 100644 --- a/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp +++ b/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp @@ -37,12 +37,10 @@ FormDataIterator::FormDataIterator(Web::XHR::FormData const& form_data, JS::Obje FormDataIterator::~FormDataIterator() = default; -JS::ThrowCompletionOr FormDataIterator::initialize(JS::Realm& realm) +void FormDataIterator::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "FormDataIterator")); - - return {}; } void FormDataIterator::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/XHR/FormDataIterator.h b/Userland/Libraries/LibWeb/XHR/FormDataIterator.h index a1f57b65d8..e07f846c04 100644 --- a/Userland/Libraries/LibWeb/XHR/FormDataIterator.h +++ b/Userland/Libraries/LibWeb/XHR/FormDataIterator.h @@ -24,7 +24,7 @@ public: private: FormDataIterator(FormData const&, JS::Object::PropertyKind iterator_kind); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_form_data; diff --git a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp index 1de4ffd169..83c7ecdf27 100644 --- a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp +++ b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp @@ -29,12 +29,10 @@ ProgressEvent::ProgressEvent(JS::Realm& realm, FlyString const& event_name, Prog ProgressEvent::~ProgressEvent() = default; -JS::ThrowCompletionOr ProgressEvent::initialize(JS::Realm& realm) +void ProgressEvent::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "ProgressEvent")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/XHR/ProgressEvent.h b/Userland/Libraries/LibWeb/XHR/ProgressEvent.h index 3fdd0bcf23..285d2480c8 100644 --- a/Userland/Libraries/LibWeb/XHR/ProgressEvent.h +++ b/Userland/Libraries/LibWeb/XHR/ProgressEvent.h @@ -36,7 +36,7 @@ public: private: ProgressEvent(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; bool m_length_computable { false }; u64 m_loaded { 0 }; diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 2628944a5d..116d9048c4 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -71,12 +71,10 @@ XMLHttpRequest::XMLHttpRequest(JS::Realm& realm, XMLHttpRequestUpload& upload_ob XMLHttpRequest::~XMLHttpRequest() = default; -JS::ThrowCompletionOr XMLHttpRequest::initialize(JS::Realm& realm) +void XMLHttpRequest::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "XMLHttpRequest")); - - return {}; } void XMLHttpRequest::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h index d2be52073e..563bf195a2 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h @@ -77,7 +77,7 @@ public: JS::NonnullGCPtr upload() const; private: - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual bool must_survive_garbage_collection() const override; diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp index 1c54f4a4db..b40e88a87b 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp @@ -17,12 +17,10 @@ XMLHttpRequestUpload::XMLHttpRequestUpload(JS::Realm& realm) XMLHttpRequestUpload::~XMLHttpRequestUpload() = default; -JS::ThrowCompletionOr XMLHttpRequestUpload::initialize(JS::Realm& realm) +void XMLHttpRequestUpload::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); set_prototype(&Bindings::ensure_web_prototype(realm, "XMLHttpRequestUpload")); - - return {}; } } diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.h index d2132fe217..9718fa3375 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.h +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.h @@ -19,7 +19,7 @@ public: private: XMLHttpRequestUpload(JS::Realm&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp b/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp index 931cc0b18e..61df4efe1e 100644 --- a/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp +++ b/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp @@ -21,16 +21,14 @@ ConsoleGlobalEnvironmentExtensions::ConsoleGlobalEnvironmentExtensions(JS::Realm { } -JS::ThrowCompletionOr ConsoleGlobalEnvironmentExtensions::initialize(JS::Realm& realm) +void ConsoleGlobalEnvironmentExtensions::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_native_accessor(realm, "$0", $0_getter, nullptr, 0); define_native_accessor(realm, "$_", $__getter, nullptr, 0); define_native_function(realm, "$", $_function, 2, JS::default_attributes); define_native_function(realm, "$$", $$_function, 2, JS::default_attributes); - - return {}; } void ConsoleGlobalEnvironmentExtensions::visit_edges(Visitor& visitor) diff --git a/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.h b/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.h index fc9d5e74b9..476000ad85 100644 --- a/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.h +++ b/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.h @@ -18,7 +18,7 @@ class ConsoleGlobalEnvironmentExtensions final : public JS::Object { public: ConsoleGlobalEnvironmentExtensions(JS::Realm&, Web::HTML::Window&); - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~ConsoleGlobalEnvironmentExtensions() override = default; void set_most_recent_result(JS::Value result) { m_most_recent_result = move(result); } diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index e5016aa9bf..58618d802c 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -41,7 +41,7 @@ public: : GlobalObject(realm) { } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~ReplObject() override = default; private: @@ -62,7 +62,7 @@ public: : JS::GlobalObject(realm) { } - virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; + virtual void initialize(JS::Realm&) override; virtual ~ScriptObject() override = default; private: @@ -346,9 +346,9 @@ static JS::ThrowCompletionOr load_json_impl(JS::VM& vm) return JS::JSONObject::parse_json_value(vm, json.value()); } -JS::ThrowCompletionOr ReplObject::initialize(JS::Realm& realm) +void ReplObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property("global", this, JS::Attribute::Enumerable); u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable; @@ -378,8 +378,6 @@ JS::ThrowCompletionOr ReplObject::initialize(JS::Realm& realm) return value; }, attr); - - return {}; } JS_DEFINE_NATIVE_FUNCTION(ReplObject::save_to_file) @@ -434,17 +432,15 @@ JS_DEFINE_NATIVE_FUNCTION(ReplObject::print) return JS::js_undefined(); } -JS::ThrowCompletionOr ScriptObject::initialize(JS::Realm& realm) +void ScriptObject::initialize(JS::Realm& realm) { - MUST_OR_THROW_OOM(Base::initialize(realm)); + Base::initialize(realm); define_direct_property("global", this, JS::Attribute::Enumerable); u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable; define_native_function(realm, "loadINI", load_ini, 1, attr); define_native_function(realm, "loadJSON", load_json, 1, attr); define_native_function(realm, "print", print, 1, attr); - - return {}; } JS_DEFINE_NATIVE_FUNCTION(ScriptObject::load_ini)