diff --git a/Userland/Libraries/LibJS/Runtime/Array.cpp b/Userland/Libraries/LibJS/Runtime/Array.cpp index f609274aa7..f293d23987 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.cpp +++ b/Userland/Libraries/LibJS/Runtime/Array.cpp @@ -159,7 +159,7 @@ ThrowCompletionOr> Array::internal_get_own_property { auto& vm = this->vm(); if (property_name.is_string() && property_name.as_string() == vm.names.length.as_string()) - return { PropertyDescriptor { .value = Value(indexed_properties().array_like_size()), .writable = m_length_writable, .enumerable = false, .configurable = false } }; + return PropertyDescriptor { .value = Value(indexed_properties().array_like_size()), .writable = m_length_writable, .enumerable = false, .configurable = false }; return Object::internal_get_own_property(property_name); } diff --git a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp index 7ae94ae4f2..198189515c 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp @@ -43,7 +43,7 @@ ThrowCompletionOr FunctionEnvironment::get_super_base() const // 3. Assert: Type(home) is Object. // 4. Return ? home.[[GetPrototypeOf]](). - return { TRY(home_object->internal_get_prototype_of()) }; + return TRY(home_object->internal_get_prototype_of()); } // 9.1.1.3.2 HasThisBinding ( ), https://tc39.es/ecma262/#sec-function-environment-records-hasthisbinding diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp index a9d3c26b83..ff6e392533 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp @@ -33,9 +33,9 @@ BoundFunction* FunctionObject::bind(Value bound_this_value, Vector argume case Value::Type::Null: if (vm.in_strict_mode()) return bound_this_value; - return { &global_object() }; + return &global_object(); default: - return { TRY(bound_this_value.to_object(global_object())) }; + return TRY(bound_this_value.to_object(global_object())); } }; auto bound_this_object = TRY_OR_DISCARD(get_bound_this_object()); diff --git a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp index 94d2133f57..ef42b5ea23 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalEnvironment.cpp @@ -35,7 +35,7 @@ void GlobalEnvironment::visit_edges(Cell::Visitor& visitor) ThrowCompletionOr GlobalEnvironment::get_this_binding(GlobalObject&) const { // 1. Return envRec.[[GlobalThisValue]]. - return { m_global_this_value }; + return m_global_this_value; } // 9.1.1.4.1 HasBinding ( N ), https://tc39.es/ecma262/#sec-global-environment-records-hasbinding-n diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp index 69eec04981..b1eb98f082 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp @@ -657,7 +657,7 @@ ThrowCompletionOr> default_number_option(GlobalObject& global_obje return vm.throw_completion(global_object, ErrorType::IntlNumberIsNaNOrOutOfRange, value, minimum, maximum); // 4. Return floor(value). - return { floor(value.as_double()) }; + return floor(value.as_double()); } // 9.2.15 GetNumberOption ( options, property, minimum, maximum, fallback ), https://tc39.es/ecma402/#sec-getnumberoption diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp index c720533c02..05af7040e9 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp @@ -117,7 +117,7 @@ ThrowCompletionOr canonical_code_for_display_names(GlobalObject& global_o // c. Set code to CanonicalizeUnicodeLocaleId(code). // d. Return code. auto canonicalized_tag = JS::Intl::canonicalize_unicode_locale_id(*locale_id); - return { js_string(vm, move(canonicalized_tag)) }; + return js_string(vm, move(canonicalized_tag)); } // 2. If type is "region", then @@ -128,7 +128,7 @@ ThrowCompletionOr canonical_code_for_display_names(GlobalObject& global_o // b. Let code be the result of mapping code to upper case as described in 6.1. // c. Return code. - return { js_string(vm, code.to_uppercase_string()) }; + return js_string(vm, code.to_uppercase_string()); } // 3. If type is "script", then @@ -139,7 +139,7 @@ ThrowCompletionOr canonical_code_for_display_names(GlobalObject& global_o // b. Let code be the result of mapping the first character in code to upper case, and mapping the second, third, and fourth character in code to lower case, as described in 6.1. // c. Return code. - return { js_string(vm, code.to_titlecase_string()) }; + return js_string(vm, code.to_titlecase_string()); } // 4. Assert: type is "currency". @@ -151,7 +151,7 @@ ThrowCompletionOr canonical_code_for_display_names(GlobalObject& global_o // 6. Let code be the result of mapping code to upper case as described in 6.1. // 7. Return code. - return { js_string(vm, code.to_uppercase_string()) }; + return js_string(vm, code.to_uppercase_string()); } } diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 8b11d69455..600dfb5365 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -676,7 +676,7 @@ ThrowCompletionOr> Object::internal_get_own_propert descriptor.configurable = attributes.is_configurable(); // 9. Return D. - return { descriptor }; + return descriptor; } // 10.1.6 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp index 1390ebb6c9..9d7b0c208d 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -312,7 +312,7 @@ ThrowCompletionOr> ProxyObject::internal_get_own_pr } // 18. Return resultDesc. - return { result_desc }; + return result_desc; } // 10.5.6 [[DefineOwnProperty]] ( P, Desc ), https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp index cdc584605b..becc7af91f 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp @@ -272,7 +272,7 @@ ThrowCompletionOr get_wrapped_value(GlobalObject& global_object, Realm& c return vm.throw_completion(global_object, ErrorType::ShadowRealmWrappedValueNonFunctionObject, value); // b. Return ! WrappedFunctionCreate(callerRealm, value). - return { WrappedFunction::create(global_object, caller_realm, value.as_function()) }; + return WrappedFunction::create(global_object, caller_realm, value.as_function()); } // 3. Return value. diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index f2a3c302ec..ab8b08e67a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -174,7 +174,7 @@ ThrowCompletionOr> get_string_or_number_option(Globa return vm.template throw_completion(global_object, ErrorType::OptionIsNotValidValue, value.as_double(), property.as_string()); // b. Return floor(ℝ(value)). - return { static_cast(floor(value.as_double())) }; + return static_cast(floor(value.as_double())); } // 4. Assert: Type(value) is String. @@ -185,7 +185,7 @@ ThrowCompletionOr> get_string_or_number_option(Globa return vm.template throw_completion(global_object, ErrorType::OptionIsNotValidValue, value.as_string().string(), property.as_string()); // 6. Return value. - return { value.as_string().string() }; + return value.as_string().string(); } // 13.6 ToTemporalOverflow ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaloverflow @@ -430,7 +430,7 @@ ThrowCompletionOr> to_smallest_temporal_unit(GlobalObject& glob } // 5. Return smallestUnit. - return { smallest_unit }; + return smallest_unit; } // 13.22 ValidateTemporalUnitRange ( largestUnit, smallestUnit ), https://tc39.es/proposal-temporal/#sec-temporal-validatetemporalunitrange @@ -871,7 +871,7 @@ ThrowCompletionOr parse_temporal_calendar_string(GlobalObject& global_ob // 4. If id is undefined, then if (!id_part.has_value()) { // a. Return "iso8601". - return { "iso8601"sv }; + return "iso8601"sv; } // 5. If ! IsBuiltinCalendar(id) is false, then @@ -881,7 +881,7 @@ ThrowCompletionOr parse_temporal_calendar_string(GlobalObject& global_ob } // 6. Return id. - return { id_part.value() }; + return id_part.value(); } // 13.38 ParseTemporalDateString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldatestring diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.h b/Userland/Libraries/LibJS/Runtime/TypedArray.h index cf947015f0..d77e6abfc2 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.h +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.h @@ -216,12 +216,12 @@ public: return Optional {}; // iii. Return the PropertyDescriptor { [[Value]]: value, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }. - return { PropertyDescriptor { + return PropertyDescriptor { .value = value, .writable = true, .enumerable = true, .configurable = true, - } }; + }; } } diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 38f9ecf55f..0c843433d0 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -337,11 +337,11 @@ ThrowCompletionOr Value::to_string(GlobalObject& global_object) const auto& vm = global_object.vm(); switch (m_type) { case Type::Undefined: - return { "undefined"sv }; + return "undefined"sv; case Type::Null: - return { "null"sv }; + return "null"sv; case Type::Boolean: - return { m_value.as_bool ? "true"sv : "false"sv }; + return m_value.as_bool ? "true"sv : "false"sv; case Type::Int32: return String::number(m_value.as_i32); case Type::Double: @@ -563,8 +563,8 @@ ThrowCompletionOr Value::to_property_key(GlobalObject& global_ob { auto key = TRY(to_primitive(global_object, PreferredType::String)); if (key.is_symbol()) - return StringOrSymbol { &key.as_symbol() }; - return StringOrSymbol { TRY(key.to_string(global_object)) }; + return &key.as_symbol(); + return TRY(key.to_string(global_object)); } ThrowCompletionOr Value::to_i32_slow_case(GlobalObject& global_object) const