summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-31 17:37:08 +0200
committerGitHub <noreply@github.com>2022-08-31 17:37:08 +0200
commit10aec9057c104b493d74dd3e815439abbac3db69 (patch)
tree827e4ee8584ee74045c7ee0609bf3d8b054ad670 /core
parentf4ec011c29b036d665fcb9c7a09d23f5beee3af3 (diff)
parent291d3aaabefa86b4e102fa7385bcf7aacd240d72 (diff)
Merge pull request #63411 from Calinou/improve-null-object-dictionary-print
Improve null and object printing to avoid confusion with arrays
Diffstat (limited to 'core')
-rw-r--r--core/object/object.cpp2
-rw-r--r--core/variant/variant.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index 4f7f55c8b6..33208be539 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -811,7 +811,7 @@ String Object::to_string() {
_extension->to_string(_extension_instance, &ret);
return ret;
}
- return "[" + get_class() + ":" + itos(get_instance_id()) + "]";
+ return "<" + get_class() + "#" + itos(get_instance_id()) + ">";
}
void Object::set_script_and_instance(const Variant &p_script, ScriptInstance *p_instance) {
diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp
index a5bc6c229d..b280fc9fe3 100644
--- a/core/variant/variant.cpp
+++ b/core/variant/variant.cpp
@@ -1787,7 +1787,7 @@ String stringify_vector(const T &vec, int recursion_count) {
String Variant::stringify(int recursion_count) const {
switch (type) {
case NIL:
- return "null";
+ return "<null>";
case BOOL:
return _data._bool ? "true" : "false";
case INT:
@@ -1904,12 +1904,12 @@ String Variant::stringify(int recursion_count) const {
case OBJECT: {
if (_get_obj().obj) {
if (!_get_obj().id.is_ref_counted() && ObjectDB::get_instance(_get_obj().id) == nullptr) {
- return "[Freed Object]";
+ return "<Freed Object>";
}
return _get_obj().obj->to_string();
} else {
- return "[Object:null]";
+ return "<Object#null>";
}
} break;
@@ -1926,7 +1926,7 @@ String Variant::stringify(int recursion_count) const {
return "RID(" + itos(s.get_id()) + ")";
} break;
default: {
- return "[" + get_type_name(type) + "]";
+ return "<" + get_type_name(type) + ">";
}
}