diff --git a/Libraries/LibWeb/Encoding/TextDecoder.cpp b/Libraries/LibWeb/Encoding/TextDecoder.cpp index 4cf4978ec0..449e4ec84b 100644 --- a/Libraries/LibWeb/Encoding/TextDecoder.cpp +++ b/Libraries/LibWeb/Encoding/TextDecoder.cpp @@ -18,7 +18,7 @@ namespace Web::Encoding { GC_DEFINE_ALLOCATOR(TextDecoder); // https://encoding.spec.whatwg.org/#dom-textdecoder -WebIDL::ExceptionOr> TextDecoder::construct_impl(JS::Realm& realm, FlyString label, Optional const& options) +WebIDL::ExceptionOr> TextDecoder::construct_impl(JS::Realm& realm, StringView label, Bindings::TextDecoderOptions const& options) { auto& vm = realm.vm(); @@ -35,10 +35,10 @@ WebIDL::ExceptionOr> TextDecoder::construct_impl(JS::Realm& auto lowercase_encoding_name = encoding.value().to_ascii_lowercase_string(); // 4. If options["fatal"] is true, then set this’s error mode to "fatal". - auto error_mode = options.value_or({}).fatal ? ErrorMode::Fatal : ErrorMode::Replacement; + auto error_mode = options.fatal ? ErrorMode::Fatal : ErrorMode::Replacement; // 5. Set this’s ignore BOM to options["ignoreBOM"]. - auto ignore_bom = options.value_or({}).ignore_bom; + auto ignore_bom = options.ignore_bom; // NOTE: This should happen in decode(), but we don't support streaming yet and share decoders across calls. auto decoder = TextCodec::decoder_for_exact_name(encoding.value()); diff --git a/Libraries/LibWeb/Encoding/TextDecoder.h b/Libraries/LibWeb/Encoding/TextDecoder.h index af9dc81939..cbed714218 100644 --- a/Libraries/LibWeb/Encoding/TextDecoder.h +++ b/Libraries/LibWeb/Encoding/TextDecoder.h @@ -27,7 +27,7 @@ class TextDecoder GC_DECLARE_ALLOCATOR(TextDecoder); public: - static WebIDL::ExceptionOr> construct_impl(JS::Realm&, FlyString encoding, Optional const& options = {}); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, StringView label, Bindings::TextDecoderOptions const&); virtual ~TextDecoder() override;