Pārlūkot izejas kodu

LibJS: Rename ErrorType::ToObjectNullOr{Undef => Undefined}

This seems like an unnecessary and uncommon abbreviation.
Linus Groh 4 gadi atpakaļ
vecāks
revīzija
cab3049dcc

+ 1 - 1
Userland/Libraries/LibJS/Runtime/ErrorTypes.h

@@ -155,7 +155,7 @@
     M(StringRepeatCountMustBe, "repeat count must be a {} number")                                                                      \
     M(StringRepeatCountMustBe, "repeat count must be a {} number")                                                                      \
     M(ThisHasNotBeenInitialized, "|this| has not been initialized")                                                                     \
     M(ThisHasNotBeenInitialized, "|this| has not been initialized")                                                                     \
     M(ThisIsAlreadyInitialized, "|this| is already 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(TypedArrayInvalidBufferLength, "Invalid buffer length for {}: must be a multiple of {}, got {}")                                  \
     M(TypedArrayInvalidByteOffset, "Invalid byte offset 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 {}")                           \
     M(TypedArrayOutOfRangeByteOffset, "Typed array byte offset {} is out of range for buffer with length {}")                           \

+ 1 - 1
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);
     auto this_object = vm.this_value(global_object);
     if (this_object.is_nullish()) {
     if (this_object.is_nullish()) {
-        vm.throw_exception<TypeError>(global_object, ErrorType::ToObjectNullOrUndef);
+        vm.throw_exception<TypeError>(global_object, ErrorType::ToObjectNullOrUndefined);
         return {};
         return {};
     }
     }
 
 

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Value.cpp

@@ -355,7 +355,7 @@ Object* Value::to_object(GlobalObject& global_object) const
     switch (m_type) {
     switch (m_type) {
     case Type::Undefined:
     case Type::Undefined:
     case Type::Null:
     case Type::Null:
-        global_object.vm().throw_exception<TypeError>(global_object, ErrorType::ToObjectNullOrUndef);
+        global_object.vm().throw_exception<TypeError>(global_object, ErrorType::ToObjectNullOrUndefined);
         return nullptr;
         return nullptr;
     case Type::Boolean:
     case Type::Boolean:
         return BooleanObject::create(global_object, m_value.as_bool);
         return BooleanObject::create(global_object, m_value.as_bool);