From cab3049dcc58d6fb85c1613bb6a23acdee13b98e Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 13 Jan 2021 20:34:44 +0100 Subject: [PATCH] LibJS: Rename ErrorType::ToObjectNullOr{Undef => Undefined} This seems like an unnecessary and uncommon abbreviation. --- Userland/Libraries/LibJS/Runtime/ErrorTypes.h | 2 +- Userland/Libraries/LibJS/Runtime/StringPrototype.cpp | 2 +- Userland/Libraries/LibJS/Runtime/Value.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/ErrorTypes.h b/Userland/Libraries/LibJS/Runtime/ErrorTypes.h index e406d4377f..a66bcb4131 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorTypes.h +++ b/Userland/Libraries/LibJS/Runtime/ErrorTypes.h @@ -155,7 +155,7 @@ M(StringRepeatCountMustBe, "repeat count must be a {} number") \ M(ThisHasNotBeenInitialized, "|this| has not been initialized") \ M(ThisIsAlreadyInitialized, "|this| is already initialized") \ - M(ToObjectNullOrUndef, "ToObject on null or undefined") \ + M(ToObjectNullOrUndefined, "ToObject on null or undefined") \ M(TypedArrayInvalidBufferLength, "Invalid buffer length for {}: must be a multiple of {}, got {}") \ M(TypedArrayInvalidByteOffset, "Invalid byte offset for {}: must be a multiple of {}, got {}") \ M(TypedArrayOutOfRangeByteOffset, "Typed array byte offset {} is out of range for buffer with length {}") \ diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index d0f4d495ff..baeeda438e 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -616,7 +616,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::symbol_iterator) { auto this_object = vm.this_value(global_object); if (this_object.is_nullish()) { - vm.throw_exception(global_object, ErrorType::ToObjectNullOrUndef); + vm.throw_exception(global_object, ErrorType::ToObjectNullOrUndefined); return {}; } diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 1d397c9536..003e0378b1 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -355,7 +355,7 @@ Object* Value::to_object(GlobalObject& global_object) const switch (m_type) { case Type::Undefined: case Type::Null: - global_object.vm().throw_exception(global_object, ErrorType::ToObjectNullOrUndef); + global_object.vm().throw_exception(global_object, ErrorType::ToObjectNullOrUndefined); return nullptr; case Type::Boolean: return BooleanObject::create(global_object, m_value.as_bool);